C# Class Procurios.Public.JSON

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.
Mostra file Open project: Synergex/Baconography

Public Methods

Method Description
GetValue ( object obj, string name ) : object
JsonDecode ( string json ) : object

Parses the string json into a value

JsonDecode ( string json, bool &success ) : object

Parses the string json into a value; and fills 'success' with the successfullness of the parse.

Protected Methods

Method Description
EatWhitespace ( char json, int &index ) : void
GetLastIndexOfNumber ( char json, int index ) : int
LookAhead ( char json, int index ) : int
NextToken ( char json, int &index ) : int
ParseArray ( char json, int &index, bool &success ) : List
ParseNumber ( char json, int &index, bool &success ) : double
ParseObject ( char json, int &index, bool &success ) : object>.Dictionary
ParseString ( char json, int &index, bool &success ) : string
ParseValue ( char json, int &index, bool &success ) : object

Method Details

EatWhitespace() protected static method

protected static EatWhitespace ( char json, int &index ) : void
json char
index int
return void

GetLastIndexOfNumber() protected static method

protected static GetLastIndexOfNumber ( char json, int index ) : int
json char
index int
return int

GetValue() public static method

public static GetValue ( object obj, string name ) : object
obj object
name string
return object

JsonDecode() public static method

Parses the string json into a value
public static JsonDecode ( string json ) : object
json string A JSON string.
return object

JsonDecode() public static method

Parses the string json into a value; and fills 'success' with the successfullness of the parse.
public static JsonDecode ( string json, bool &success ) : object
json string A JSON string.
success bool Successful parse?
return object

LookAhead() protected static method

protected static LookAhead ( char json, int index ) : int
json char
index int
return int

NextToken() protected static method

protected static NextToken ( char json, int &index ) : int
json char
index int
return int

ParseArray() protected static method

protected static ParseArray ( char json, int &index, bool &success ) : List
json char
index int
success bool
return List

ParseNumber() protected static method

protected static ParseNumber ( char json, int &index, bool &success ) : double
json char
index int
success bool
return double

ParseObject() protected static method

protected static ParseObject ( char json, int &index, bool &success ) : object>.Dictionary
json char
index int
success bool
return object>.Dictionary

ParseString() protected static method

protected static ParseString ( char json, int &index, bool &success ) : string
json char
index int
success bool
return string

ParseValue() protected static method

protected static ParseValue ( char json, int &index, bool &success ) : object
json char
index int
success bool
return object