C# Class Netduino.WebServer.Core.Json.JsonParser

Parses JSON strings into a Hashtable. The Hashtable contains one or more key/value pairs (DictionaryEntry objects). Each key is the name of a property that (hopefully) exists in the class object that it represents. Each value is one of the following: Hastable - Another list of one or more DictionaryEntry objects, essentially representing a property that is another class. ArrayList - An array of one or more objects, which themselves can be one of the items enumerated in this list. Value Type - an actual value, such as a string, int, bool, Guid, DateTime, etc
Afficher le fichier Open project: martinbuberl/Netduino

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
EatWhitespace ( char json, int &index ) : void
GetLastIndexOfNumber ( char json, int index ) : int
IsNumeric ( object o ) : bool

Determines if a given object is numeric in any way (can be integer, double, null, etc). Thanks to mtighe for pointing out Double.TryParse to me.

LookAhead ( char json, int index ) : Token
NextToken ( char json, int &index ) : Token
ParseArray ( char json, int &index, bool &success ) : ArrayList
ParseNumber ( char json, int &index, bool &success ) : object

Determines the type of number (int, double, etc) and returns an object containing that value.

ParseObject ( char json, int &index, bool &success ) : Hashtable
ParseString ( char json, int &index, bool &success ) : string
ParseValue ( char json, int &index, bool &success ) : object
SerializeArray ( ArrayList anArray, StringBuilder builder ) : bool
SerializeNumber ( double number, StringBuilder builder ) : bool
SerializeObject ( Hashtable anObject, StringBuilder builder ) : bool
SerializeString ( string aString, StringBuilder builder ) : bool
SerializeValue ( object value, StringBuilder builder ) : bool

Method Details

EatWhitespace() protected static méthode

protected static EatWhitespace ( char json, int &index ) : void
json char
index int
Résultat void

GetLastIndexOfNumber() protected static méthode

protected static GetLastIndexOfNumber ( char json, int index ) : int
json char
index int
Résultat int

IsNumeric() protected static méthode

Determines if a given object is numeric in any way (can be integer, double, null, etc). Thanks to mtighe for pointing out Double.TryParse to me.
protected static IsNumeric ( object o ) : bool
o object
Résultat bool

JsonDecode() public static méthode

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

JsonDecode() public static méthode

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?
Résultat object

LookAhead() protected static méthode

protected static LookAhead ( char json, int index ) : Token
json char
index int
Résultat Token

NextToken() protected static méthode

protected static NextToken ( char json, int &index ) : Token
json char
index int
Résultat Token

ParseArray() protected static méthode

protected static ParseArray ( char json, int &index, bool &success ) : ArrayList
json char
index int
success bool
Résultat System.Collections.ArrayList

ParseNumber() protected static méthode

Determines the type of number (int, double, etc) and returns an object containing that value.
protected static ParseNumber ( char json, int &index, bool &success ) : object
json char
index int
success bool
Résultat object

ParseObject() protected static méthode

protected static ParseObject ( char json, int &index, bool &success ) : Hashtable
json char
index int
success bool
Résultat System.Collections.Hashtable

ParseString() protected static méthode

protected static ParseString ( char json, int &index, bool &success ) : string
json char
index int
success bool
Résultat string

ParseValue() protected static méthode

protected static ParseValue ( char json, int &index, bool &success ) : object
json char
index int
success bool
Résultat object

SerializeArray() protected static méthode

protected static SerializeArray ( ArrayList anArray, StringBuilder builder ) : bool
anArray System.Collections.ArrayList
builder StringBuilder
Résultat bool

SerializeNumber() protected static méthode

protected static SerializeNumber ( double number, StringBuilder builder ) : bool
number double
builder StringBuilder
Résultat bool

SerializeObject() protected static méthode

protected static SerializeObject ( Hashtable anObject, StringBuilder builder ) : bool
anObject System.Collections.Hashtable
builder StringBuilder
Résultat bool

SerializeString() protected static méthode

protected static SerializeString ( string aString, StringBuilder builder ) : bool
aString string
builder StringBuilder
Résultat bool

SerializeValue() protected static méthode

protected static SerializeValue ( object value, StringBuilder builder ) : bool
value object
builder StringBuilder
Résultat bool