LuaSTG-x Core API
json Class Reference

Public Member Functions

static function decode (local s, local startPos)
 
static function encode (local v)
 
static function null ()
 

Detailed Description

array of commandline arguments

string[]

Member Function Documentation

◆ decode()

static function decode ( local  s,
local  startPos 
)

Decodes a JSON string and returns the decoded value as a Lua data structure / value.

Parameters
sstring @The string to scan.
startPosnumber @Optional starting position where the JSON string is located. Defaults to 1.
Returns
any,number @Lua object, number The object that was scanned, as a Lua table / string / number / boolean or nil and the position of the first character after the scanned JSON object.

◆ encode()

static function encode ( local  v)

Encodes an arbitrary Lua object / variable.

Parameters
vtable @The Lua object / variable to be JSON encoded.
Returns
string @containing the JSON encoding in internal Lua string format (i.e. not unicode)

◆ null()

static function null ( )

The null function allows one to specify a null value in an associative array (which is otherwise

discarded if you set the value with 'nil' in Lua. Simply set t = { first=json.null }


The documentation for this class was generated from the following file: