EGDL2 2.1
Loading...
Searching...
No Matches
Enablegames.MiniJSON Class Reference

This class encodes and decodes JSON strings. Spec. details, see http://www.json.org/. More...

Static Public Member Functions

static object jsonDecode (string json)
 Parses the string json into a value.
 
static string jsonEncode (object json)
 Converts a Hashtable / ArrayList / Dictionary(string,string) object into a JSON string.
 
static bool lastDecodeSuccessful ()
 On decoding, this function returns the position at which the parse failed (-1 = no error).
 
static int getLastErrorIndex ()
 On decoding, this function returns the position at which the parse failed (-1 = no error).
 
static string getLastErrorSnippet ()
 If a decoding error occurred, this function returns a piece of the JSON string at which the error took place. To ease debugging.
 

Static Protected Attributes

static int lastErrorIndex = -1
 On decoding, this value holds the position at which the parse failed (-1 = no error).
 

Detailed Description

This class encodes and decodes JSON strings. Spec. details, see http://www.json.org/.

JSON uses Arrays and Objects. These correspond here to the datatypes ArrayList and Hashtable. All numbers are parsed to doubles.

Member Function Documentation

◆ getLastErrorIndex()

static int Enablegames.MiniJSON.getLastErrorIndex ( )
inlinestatic

On decoding, this function returns the position at which the parse failed (-1 = no error).

Returns

◆ getLastErrorSnippet()

static string Enablegames.MiniJSON.getLastErrorSnippet ( )
inlinestatic

If a decoding error occurred, this function returns a piece of the JSON string at which the error took place. To ease debugging.

Returns

◆ jsonDecode()

static object Enablegames.MiniJSON.jsonDecode ( string json)
inlinestatic

Parses the string json into a value.

Parameters
jsonA JSON string.
Returns
An ArrayList, a Hashtable, a double, a string, null, true, or false

◆ jsonEncode()

static string Enablegames.MiniJSON.jsonEncode ( object json)
inlinestatic

Converts a Hashtable / ArrayList / Dictionary(string,string) object into a JSON string.

Parameters
jsonA Hashtable / ArrayList
Returns
A JSON encoded string, or null if object 'json' is not serializable

◆ lastDecodeSuccessful()

static bool Enablegames.MiniJSON.lastDecodeSuccessful ( )
inlinestatic

On decoding, this function returns the position at which the parse failed (-1 = no error).

Returns

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