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 "../JsonUtils.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

◆ JsonSerializeTable()

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 178 of file LuaJson.cpp.

◆ JsonSerializeValue()

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 230 of file LuaJson.cpp.

◆ PushJsonArray()

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 77 of file LuaJson.cpp.

◆ PushJsonObject()

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 99 of file LuaJson.cpp.

◆ PushJsonValue()

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 128 of file LuaJson.cpp.

◆ tolua_cJson_Parse()

static int tolua_cJson_Parse ( lua_State *  a_LuaState)
static

Definition at line 272 of file LuaJson.cpp.

◆ tolua_cJson_Serialize()

static int tolua_cJson_Serialize ( lua_State *  a_LuaState)
static

Definition at line 315 of file LuaJson.cpp.