This class encodes and decodes JSON strings. Spec. details, see http://www.json.org/
More...
|
static void | LoadSpriteData (UIAtlas atlas, TextAsset asset) |
| Parse the specified JSon file, loading sprite information for the specified atlas. More...
|
|
static void | LoadSpriteData (UIAtlas atlas, string jsonData) |
| Parse the specified JSon file, loading sprite information for the specified atlas. 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 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 Hashtable | parseObject (char[] json, ref int index) |
|
static ArrayList | parseArray (char[] json, ref int index) |
|
static object | parseValue (char[] json, ref int index, ref bool success) |
|
static string | parseString (char[] json, ref int index) |
|
static double | parseNumber (char[] json, ref int index) |
|
static int | getLastIndexOfNumber (char[] json, int index) |
|
static void | eatWhitespace (char[] json, ref int index) |
|
static int | lookAhead (char[] json, int index) |
|
static int | nextToken (char[] json, ref int index) |
|
static bool | serializeObjectOrArray (object objectOrArray, StringBuilder builder) |
|
static bool | serializeObject (Hashtable anObject, StringBuilder builder) |
|
static bool | serializeDictionary (Dictionary< string, string > dict, StringBuilder builder) |
|
static bool | serializeArray (ArrayList anArray, StringBuilder builder) |
|
static bool | serializeValue (object value, StringBuilder builder) |
|
static void | serializeString (string aString, StringBuilder builder) |
|
static void | serializeNumber (double number, StringBuilder builder) |
|
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.
static void NGUIJson.eatWhitespace |
( |
char[] |
json, |
|
|
ref int |
index |
|
) |
| |
|
staticprotected |
static int NGUIJson.getLastErrorIndex |
( |
| ) |
|
|
static |
On decoding, this function returns the position at which the parse failed (-1 = no error).
- Returns
static string NGUIJson.getLastErrorSnippet |
( |
| ) |
|
|
static |
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 NGUIJson.getLastIndexOfNumber |
( |
char[] |
json, |
|
|
int |
index |
|
) |
| |
|
staticprotected |
static object NGUIJson.jsonDecode |
( |
string |
json | ) |
|
|
static |
Parses the string json into a value
- Parameters
-
- Returns
- An ArrayList, a Hashtable, a double, a string, null, true, or false
static string NGUIJson.jsonEncode |
( |
object |
json | ) |
|
|
static |
Converts a Hashtable / ArrayList / Dictionary(string,string) object into a JSON string
- Parameters
-
json | A Hashtable / ArrayList |
- Returns
- A JSON encoded string, or null if object 'json' is not serializable
static bool NGUIJson.lastDecodeSuccessful |
( |
| ) |
|
|
static |
On decoding, this function returns the position at which the parse failed (-1 = no error).
- Returns
static void NGUIJson.LoadSpriteData |
( |
UIAtlas |
atlas, |
|
|
TextAsset |
asset |
|
) |
| |
|
static |
Parse the specified JSon file, loading sprite information for the specified atlas.
static void NGUIJson.LoadSpriteData |
( |
UIAtlas |
atlas, |
|
|
string |
jsonData |
|
) |
| |
|
static |
Parse the specified JSon file, loading sprite information for the specified atlas.
static int NGUIJson.lookAhead |
( |
char[] |
json, |
|
|
int |
index |
|
) |
| |
|
staticprotected |
static int NGUIJson.nextToken |
( |
char[] |
json, |
|
|
ref int |
index |
|
) |
| |
|
staticprotected |
static ArrayList NGUIJson.parseArray |
( |
char[] |
json, |
|
|
ref int |
index |
|
) |
| |
|
staticprotected |
static double NGUIJson.parseNumber |
( |
char[] |
json, |
|
|
ref int |
index |
|
) |
| |
|
staticprotected |
static Hashtable NGUIJson.parseObject |
( |
char[] |
json, |
|
|
ref int |
index |
|
) |
| |
|
staticprotected |
static string NGUIJson.parseString |
( |
char[] |
json, |
|
|
ref int |
index |
|
) |
| |
|
staticprotected |
static object NGUIJson.parseValue |
( |
char[] |
json, |
|
|
ref int |
index, |
|
|
ref bool |
success |
|
) |
| |
|
staticprotected |
static bool NGUIJson.serializeArray |
( |
ArrayList |
anArray, |
|
|
StringBuilder |
builder |
|
) |
| |
|
staticprotected |
static bool NGUIJson.serializeDictionary |
( |
Dictionary< string, string > |
dict, |
|
|
StringBuilder |
builder |
|
) |
| |
|
staticprotected |
static void NGUIJson.serializeNumber |
( |
double |
number, |
|
|
StringBuilder |
builder |
|
) |
| |
|
staticprotected |
static bool NGUIJson.serializeObject |
( |
Hashtable |
anObject, |
|
|
StringBuilder |
builder |
|
) |
| |
|
staticprotected |
static bool NGUIJson.serializeObjectOrArray |
( |
object |
objectOrArray, |
|
|
StringBuilder |
builder |
|
) |
| |
|
staticprotected |
static void NGUIJson.serializeString |
( |
string |
aString, |
|
|
StringBuilder |
builder |
|
) |
| |
|
staticprotected |
static bool NGUIJson.serializeValue |
( |
object |
value, |
|
|
StringBuilder |
builder |
|
) |
| |
|
staticprotected |
string NGUIJson.lastDecode = "" |
|
staticprotected |
int NGUIJson.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:
- D:/Projects/NGUI/Assets/NGUI/Scripts/Editor/NGUIJson.cs