/* * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once #include #include #include #include #include struct lua_State; namespace Swift { namespace Lua { struct Nil {}; typedef boost::make_recursive_variant< Nil, bool, int, std::string, std::vector< boost::recursive_variant_ >, std::map > >::type Value; typedef std::map > Table; typedef std::vector Array; inline std::shared_ptr nilRef() { return std::make_shared(Nil()); } inline std::shared_ptr valueRef(const std::string& value) { return std::make_shared(value); } inline std::shared_ptr intRef(int value) { return std::make_shared(value); } inline std::shared_ptr boolRef(bool value) { return std::make_shared(value); } inline std::shared_ptr valueRef(const Table& table) { return std::make_shared(table); } inline std::shared_ptr valueRef(const Array& array) { return std::make_shared(array); } void pushValue(lua_State* state, const Value& value); } }