Cuberite
A lightweight, fast and extensible game server for Minecraft
Classes | Functions
LuaJson.cpp File Reference
#include "Globals.h"
#include <sstream>
#include "LuaJson.h"
#include "LuaState.h"
#include "tolua++/include/tolua++.h"
#include "json/json.h"
Include dependency graph for LuaJson.cpp:

Go to the source code of this file.

Classes

class  CannotSerializeException
 Exception thrown when the input cannot be serialized. More...
 

Functions

static Json::Value JsonSerializeTable (cLuaState &a_LuaState)
 Serializes the Lua table at the top of the specified Lua state's stack into a Json value. More...
 
static Json::Value JsonSerializeValue (cLuaState &a_LuaState)
 Serializes the Lua value at the top of the specified Lua state into a Json value. More...
 
static void PushJsonArray (const Json::Value &a_Value, cLuaState &a_LuaState)
 Pushes the specified Json array as a table on top of the specified Lua state. More...
 
static void PushJsonObject (const Json::Value &a_Value, cLuaState &a_LuaState)
 Pushes the specified Json object as a table on top of the specified Lua state. More...
 
static void PushJsonValue (const Json::Value &a_Value, cLuaState &a_LuaState)
 Pushes the specified Json value as an appropriate type on top of the specified Lua state. More...
 
static int tolua_cJson_Parse (lua_State *a_LuaState)
 
static int tolua_cJson_Serialize (lua_State *a_LuaState)
 

Function Documentation

static Json::Value JsonSerializeTable ( cLuaState a_LuaState)
static

Serializes the Lua table at the top of the specified Lua state's stack into a Json value.

Lets jsoncpp decides whether to serialize into an object or an array.

Definition at line 176 of file LuaJson.cpp.

static Json::Value JsonSerializeValue ( cLuaState a_LuaState)
static

Serializes the Lua value at the top of the specified Lua state into a Json value.

Definition at line 228 of file LuaJson.cpp.

static void PushJsonArray ( const Json::Value &  a_Value,
cLuaState a_LuaState 
)
static

Pushes the specified Json array as a table on top of the specified Lua state.

Assumes that a_Value is an array.

Definition at line 75 of file LuaJson.cpp.

static void PushJsonObject ( const Json::Value &  a_Value,
cLuaState a_LuaState 
)
static

Pushes the specified Json object as a table on top of the specified Lua state.

Assumes that a_Value is an object.

Definition at line 97 of file LuaJson.cpp.

void PushJsonValue ( const Json::Value &  a_Value,
cLuaState a_LuaState 
)
static

Pushes the specified Json value as an appropriate type on top of the specified Lua state.

Definition at line 126 of file LuaJson.cpp.

static int tolua_cJson_Parse ( lua_State *  a_LuaState)
static

Definition at line 270 of file LuaJson.cpp.

static int tolua_cJson_Serialize ( lua_State *  a_LuaState)
static

Definition at line 313 of file LuaJson.cpp.