Class 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 IList and IDictionary. All numbers are parsed to doubles.
Namespace: AssetBundleGraph
Syntax
public static class Json
Methods
Deserialize(String)
Parses the string json into a value
Declaration
public static object Deserialize(string json)
Parameters
Type | Name | Description |
---|---|---|
String | json | A JSON string. |
Returns
Type | Description |
---|---|
Object | An List<object>, a Dictionary<string, object>, a double, an integer,a string, null, true, or false |
Prettify(String)
Declaration
public static string Prettify(string sourceJson)
Parameters
Type | Name | Description |
---|---|---|
String | sourceJson |
Returns
Type | Description |
---|---|
String |
Serialize(Object)
Converts a IDictionary / IList object or a simple type (string, int, etc.) into a JSON string
Declaration
public static string Serialize(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
String | A JSON encoded string, or null if object 'json' is not serializable |