static int readOnlyError (lua_State* L)
{
std::string s;
-
+
s = s + "'" + lua_tostring (L, lua_upvalueindex (1)) + "' is read-only";
return luaL_error (L, s.c_str ());
}
-
+
//----------------------------------------------------------------------------
/**
lua_CFunction to get a variable.
//------------------------------------------------------------------------------
/*
https://github.com/vinniefalco/LuaBridge
-
+
Copyright 2012, Vinnie Falco <vinnie.falco@gmail.com>
License: The MIT License (http://www.opensource.org/licenses/mit-license.php)
//------------------------------------------------------------------------------
/*
https://github.com/vinniefalco/LuaBridge
-
+
Copyright 2012, Vinnie Falco <vinnie.falco@gmail.com>
Copyright 2007, Nathan Reed
template <class T, class P1, class P2, class P3, class P4,
class P5, class P6, class P7, class P8>
struct Constructor <T, TypeList <P1, TypeList <P2, TypeList <P3,
- TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7,
+ TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7,
TypeList <P8> > > > > > > > >
{
static T* call (const TypeListValues<TypeList <P1, TypeList <P2,
//------------------------------------------------------------------------------
/*
https://github.com/vinniefalco/LuaBridge
-
+
Copyright 2012, Vinnie Falco <vinnie.falco@gmail.com>
License: The MIT License (http://www.opensource.org/licenses/mit-license.php)
//------------------------------------------------------------------------------
/*
https://github.com/vinniefalco/LuaBridge
-
+
Copyright 2012, Vinnie Falco <vinnie.falco@gmail.com>
License: The MIT License (http://www.opensource.org/licenses/mit-license.php)
//------------------------------------------------------------------------------
/*
https://github.com/vinniefalco/LuaBridge
-
+
Copyright 2012, Vinnie Falco <vinnie.falco@gmail.com>
Copyright 2008, Nigel Atkinson <suprapilot+LuaCode@gmail.com>
*/
//==============================================================================
-class LuaException : public std::exception
+class LuaException : public std::exception
{
private:
lua_State* m_L;
//------------------------------------------------------------------------------
/*
https://github.com/vinniefalco/LuaBridge
-
+
Copyright 2012, Vinnie Falco <vinnie.falco@gmail.com>
Copyright 2007, Nathan Reed
#endif
/** Get a table value, bypassing metamethods.
-*/
+*/
inline void rawgetfield (lua_State* L, int index, char const* key)
{
assert (lua_istable (L, index));
}
/** Set a table value, bypassing metamethods.
-*/
+*/
inline void rawsetfield (lua_State* L, int index, char const* key)
{
assert (lua_istable (L, index));
//------------------------------------------------------------------------------
/*
https://github.com/vinniefalco/LuaBridge
-
+
Copyright 2012, Vinnie Falco <vinnie.falco@gmail.com>
Copyright 2008, Nigel Atkinson <suprapilot+LuaCode@gmail.com>
//------------------------------------------------------------------------------
/*
https://github.com/vinniefalco/LuaBridge
-
+
Copyright 2012, Vinnie Falco <vinnie.falco@gmail.com>
Copyright 2007, Nathan Reed
rawsetfield (L, -2, "__newindex");
lua_newtable (L);
rawsetfield (L, -2, "__propget");
-
+
if (Security::hideMetatables ())
{
lua_pushnil (L);
assert (lua_istable (L, -1));
rawgetfield (L, -1, name);
-
+
if (lua_isnil (L, -1))
{
lua_pop (L, 1);
{
typedef U (*get_t)();
typedef void (*set_t)(U);
-
+
assert (lua_istable (L, -1));
rawgetfield (L, -1, "__propget");
return *this;
}
-
+
//----------------------------------------------------------------------------
/**
Add or replace a property.
{
lua_pushinteger (L, static_cast <lua_Integer> (value));
}
-
+
static inline int get (lua_State* L, int index)
{
return static_cast <int> (luaL_checkinteger (L, index));
{
lua_pushnumber (L, static_cast <lua_Number> (value));
}
-
+
static inline int get (lua_State* L, int index)
{
return static_cast <int > (luaL_checknumber (L, index));
{
lua_pushinteger (L, static_cast <lua_Integer> (value));
}
-
+
static inline unsigned int get (lua_State* L, int index)
{
return static_cast <unsigned int> (luaL_checkinteger (L, index));
{
lua_pushnumber (L, static_cast <lua_Number> (value));
}
-
+
static inline unsigned int get (lua_State* L, int index)
{
return static_cast <unsigned int > (luaL_checknumber (L, index));
{
lua_pushinteger (L, static_cast <lua_Integer> (value));
}
-
+
static inline unsigned char get (lua_State* L, int index)
{
return static_cast <unsigned char> (luaL_checkinteger (L, index));
{
lua_pushnumber (L, static_cast <lua_Number> (value));
}
-
+
static inline unsigned char get (lua_State* L, int index)
{
return static_cast <unsigned char> (luaL_checknumber (L, index));
{
lua_pushinteger (L, static_cast <lua_Integer> (value));
}
-
+
static inline short get (lua_State* L, int index)
{
return static_cast <short> (luaL_checkinteger (L, index));
{
lua_pushnumber (L, static_cast <lua_Number> (value));
}
-
+
static inline short get (lua_State* L, int index)
{
return static_cast <short> (luaL_checknumber (L, index));
{
lua_pushinteger (L, static_cast <lua_Integer> (value));
}
-
+
static inline unsigned short get (lua_State* L, int index)
{
return static_cast <unsigned short> (luaL_checkinteger (L, index));
{
lua_pushnumber (L, static_cast <lua_Number> (value));
}
-
+
static inline unsigned short get (lua_State* L, int index)
{
return static_cast <unsigned short> (luaL_checknumber (L, index));
{
lua_pushinteger (L, static_cast <lua_Integer> (value));
}
-
+
static inline long get (lua_State* L, int index)
{
return static_cast <long> (luaL_checkinteger (L, index));
{
lua_pushnumber (L, static_cast <lua_Number> (value));
}
-
+
static inline long get (lua_State* L, int index)
{
return static_cast <long> (luaL_checknumber (L, index));
{
lua_pushinteger (L, static_cast <lua_Integer> (value));
}
-
+
static inline unsigned long get (lua_State* L, int index)
{
return static_cast <unsigned long> (luaL_checkinteger (L, index));
{
lua_pushnumber (L, static_cast <lua_Number> (value));
}
-
+
static inline unsigned long get (lua_State* L, int index)
{
return static_cast <unsigned long> (luaL_checknumber (L, index));
{
lua_pushnumber (L, static_cast <lua_Number> (value));
}
-
+
static inline float get (lua_State* L, int index)
{
return static_cast <float> (luaL_checknumber (L, index));
{
lua_pushnumber (L, static_cast <lua_Number> (value));
}
-
+
static inline float get (lua_State* L, int index)
{
return static_cast <float> (luaL_checknumber (L, index));
{
lua_pushnumber (L, static_cast <lua_Number> (value));
}
-
+
static inline double get (lua_State* L, int index)
{
return static_cast <double> (luaL_checknumber (L, index));
{
lua_pushnumber (L, static_cast <lua_Number> (value));
}
-
+
static inline double get (lua_State* L, int index)
{
return static_cast <double> (luaL_checknumber (L, index));
{
lua_pushboolean (L, value ? 1 : 0);
}
-
+
static inline bool get (lua_State* L, int index)
{
return lua_toboolean (L, index) ? true : false;
{
lua_pushboolean (L, value ? 1 : 0);
}
-
+
static inline bool get (lua_State* L, int index)
{
return lua_toboolean (L, index) ? true : false;
char str [2] = { value, 0 };
lua_pushstring (L, str);
}
-
+
static inline char get (lua_State* L, int index)
{
return luaL_checkstring (L, index) [0];
char str [2] = { value, 0 };
lua_pushstring (L, str);
}
-
+
static inline char get (lua_State* L, int index)
{
return luaL_checkstring (L, index) [0];
//------------------------------------------------------------------------------
/*
https://github.com/vinniefalco/LuaBridge
-
+
Copyright 2012, Vinnie Falco <vinnie.falco@gmail.com>
Copyright 2007, Nathan Reed
SOFTWARE.
This file incorporates work covered by the following copyright and
- permission notice:
+ permission notice:
The Loki Library
Copyright (c) 2001 by Andrei Alexandrescu
This code accompanies the book:
- Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design
+ Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design
Patterns Applied". Copyright (c) 2001. Addison-Wesley.
- Permission to use, copy, modify, distribute and sell this software for any
- purpose is hereby granted without fee, provided that the above copyright
- notice appear in all copies and that both that copyright notice and this
+ Permission to use, copy, modify, distribute and sell this software for any
+ purpose is hereby granted without fee, provided that the above copyright
+ notice appear in all copies and that both that copyright notice and this
permission notice appear in supporting documentation.
- The author or Addison-Welsey Longman make no representations about the
- suitability of this software for any purpose. It is provided "as is"
+ The author or Addison-Welsey Longman make no representations about the
+ suitability of this software for any purpose. It is provided "as is"
without express or implied warranty.
*/
//==============================================================================
//------------------------------------------------------------------------------
/*
https://github.com/vinniefalco/LuaBridge
-
+
Copyright 2012, Vinnie Falco <vinnie.falco@gmail.com>
License: The MIT License (http://www.opensource.org/licenses/mit-license.php)
template <typename C>
static no& test (typename C::isNotContainer*);
-
+
template <typename>
static yes& test (...);
-
+
public:
static const bool value = sizeof (test <ContainerTraits <T> >(0)) == sizeof (yes);
};
{
lua_pop (L, 2);
mismatch = true;
- }
+ }
}
if (!mismatch)
{
lua_pop (L, 2);
mismatch = true;
- }
+ }
}
else
{
luaL_error (L, "nil passed to reference");
return *t;
}
-
+
};
// reference to const
struct Stack <T const&>
{
typedef RefStackHelper <T, TypeTraits::isContainer <T>::value> helper_t;
-
+
static inline void push (lua_State* L, T const& t)
{
helper_t::push (L, t);
ostr << " " << i << ": '" << lua_tostring(L, i) << "'\n";
break;
case LUA_TBOOLEAN:
- ostr << " " << i << ": " <<
+ ostr << " " << i << ": " <<
(lua_toboolean(L, i) ? "true" : "false") << "\n";
break;
case LUA_TNUMBER: