OOLua  2.0.1
C++ and Lua binding
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
OOLUA::STRING Namespace Reference

Defines which type of string classes can be pulled and pushed from the stack with the public API and the DSL. More...

Classes

struct  only_std_string_conforming_with_c_str_method
 Defines the structure which checks for the method "c_str" which conforms to the std::string signature. More...
 
struct  is_integral_string_class
 Preforms the check on the type without including the string header. More...
 

Functions

template<typename StringType >
bool push (lua_State *const vm, StringType const &value)
 Function to which public API calls resolve to.
 
template<typename StringType >
bool pull (lua_State *const vm, StringType &value)
 Function to which public API calls resolve to.
 
template<typename StringType >
void get (lua_State *const vm, int idx, StringType &value)
 Internal function used by the DSL to retrieve a string from the stack. More...
 

Detailed Description

Defines which type of string classes can be pulled and pushed from the stack with the public API and the DSL.

I would really like to be able to forward declare string types in a cross platform way. For example when using GCC we could, but really shouldn't, use bits/stringfwd.h. However this is just not possible. Instead this file and its accompanying source file, oolua_string.cpp, provide a way to not include the string header through out the library DSL headers, yet still be able to use a string type when needed. It also facilitates the addition, and therefore interaction, of other string types with Lua. To allow a string type to be compatible with OOLua requires that three functions are defined for the type(push, pull and get) and is_integral_string_class::value must be a compile time value that returns one for the type.