Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Static Public Member Functions | Static Protected Member Functions | Static Protected Attributes | List of all members
EdyCommonTools.MiniJSON Class Reference

Static Public Member Functions

static int getLastErrorIndex ()
 On decoding, this function returns the position at which the parse failed (-1 = no error). More...
 
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. More...
 
static object jsonDecode (string json)
 Parses the string json into a value More...
 
static string jsonEncode (object json)
 Converts a Hashtable / ArrayList / Dictionary(string,string) object into a JSON string More...
 
static bool lastDecodeSuccessful ()
 On decoding, this function returns the position at which the parse failed (-1 = no error). More...
 

Static Protected Member Functions

static void eatWhitespace (char[] json, ref int index)
 
static int getLastIndexOfNumber (char[] json, int index)
 
static int lookAhead (char[] json, int index)
 
static int nextToken (char[] json, ref int index)
 
static ArrayList parseArray (char[] json, ref int index)
 
static double parseNumber (char[] json, ref int index)
 
static Hashtable parseObject (char[] json, ref int index)
 
static string parseString (char[] json, ref int index)
 
static object parseValue (char[] json, ref int index, ref bool success)
 
static bool serializeArray (ArrayList anArray, StringBuilder builder)
 
static bool serializeDictionary (Dictionary< string, string > dict, StringBuilder builder)
 
static void serializeNumber (double number, StringBuilder builder)
 
static bool serializeObject (Hashtable anObject, StringBuilder builder)
 
static bool serializeObjectOrArray (object objectOrArray, StringBuilder builder)
 
static void serializeString (string aString, StringBuilder builder)
 
static bool serializeValue (object value, StringBuilder builder)
 

Static Protected Attributes

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

Member Function Documentation

static void EdyCommonTools.MiniJSON.eatWhitespace ( char[]  json,
ref int  index 
)
inlinestaticprotected
static int EdyCommonTools.MiniJSON.getLastErrorIndex ( )
inlinestatic

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

Returns
static string EdyCommonTools.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
static int EdyCommonTools.MiniJSON.getLastIndexOfNumber ( char[]  json,
int  index 
)
inlinestaticprotected
static object EdyCommonTools.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
static string EdyCommonTools.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
static bool EdyCommonTools.MiniJSON.lastDecodeSuccessful ( )
inlinestatic

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

Returns
static int EdyCommonTools.MiniJSON.lookAhead ( char[]  json,
int  index 
)
inlinestaticprotected
static int EdyCommonTools.MiniJSON.nextToken ( char[]  json,
ref int  index 
)
inlinestaticprotected
static ArrayList EdyCommonTools.MiniJSON.parseArray ( char[]  json,
ref int  index 
)
inlinestaticprotected
static double EdyCommonTools.MiniJSON.parseNumber ( char[]  json,
ref int  index 
)
inlinestaticprotected
static Hashtable EdyCommonTools.MiniJSON.parseObject ( char[]  json,
ref int  index 
)
inlinestaticprotected
static string EdyCommonTools.MiniJSON.parseString ( char[]  json,
ref int  index 
)
inlinestaticprotected
static object EdyCommonTools.MiniJSON.parseValue ( char[]  json,
ref int  index,
ref bool  success 
)
inlinestaticprotected
static bool EdyCommonTools.MiniJSON.serializeArray ( ArrayList  anArray,
StringBuilder  builder 
)
inlinestaticprotected
static bool EdyCommonTools.MiniJSON.serializeDictionary ( Dictionary< string, string >  dict,
StringBuilder  builder 
)
inlinestaticprotected
static void EdyCommonTools.MiniJSON.serializeNumber ( double  number,
StringBuilder  builder 
)
inlinestaticprotected
static bool EdyCommonTools.MiniJSON.serializeObject ( Hashtable  anObject,
StringBuilder  builder 
)
inlinestaticprotected
static bool EdyCommonTools.MiniJSON.serializeObjectOrArray ( object  objectOrArray,
StringBuilder  builder 
)
inlinestaticprotected
static void EdyCommonTools.MiniJSON.serializeString ( string  aString,
StringBuilder  builder 
)
inlinestaticprotected
static bool EdyCommonTools.MiniJSON.serializeValue ( object  value,
StringBuilder  builder 
)
inlinestaticprotected

Member Data Documentation

string EdyCommonTools.MiniJSON.lastDecode = ""
staticprotected
int EdyCommonTools.MiniJSON.lastErrorIndex = -1
staticprotected

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


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