Class JsonData.Object
Represents a non-null object in JSON data.
public class JsonData.Object : Dictionary<string, JsonData>, IDictionary<string, JsonData>, ICollection<KeyValuePair<string, JsonData>>, IReadOnlyDictionary<string, JsonData>, IReadOnlyCollection<KeyValuePair<string, JsonData>>, IEnumerable<KeyValuePair<string, JsonData>>, IDictionary, ICollection, IEnumerable, IDeserializationCallback, ISerializable, JsonData
- Inheritance
-
JsonData.Object
- Implements
- Inherited Members
Constructors
Object()
public Object()
Object(IDictionary<string, JsonData>)
public Object(IDictionary<string, JsonData> collection)
Parameters
collection
IDictionary<string, JsonData>
Object(IEnumerable<KeyValuePair<string, JsonData>>)
public Object(IEnumerable<KeyValuePair<string, JsonData>> collection)
Parameters
collection
IEnumerable<KeyValuePair<string, JsonData>>
Object(int)
public Object(int capacity)
Parameters
capacity
int
Methods
Add(string, Bool)
public void Add(string key, JsonData.Bool value)
Parameters
Add(string, Float)
public void Add(string key, JsonData.Float value)
Parameters
Add(string, Int)
public void Add(string key, JsonData.Int value)
Parameters
Add(string, List)
public void Add(string key, JsonData.List value)
Parameters
Add(string, Null)
public void Add(string key, JsonData.Null value)
Parameters
Add(string, Object)
public void Add(string key, JsonData.Object value)
Parameters
Add(string, String)
public void Add(string key, JsonData.String value)
Parameters
Add(string, bool)
public void Add(string key, bool value)
Parameters
Add(string, int)
public void Add(string key, int value)
Parameters
Add(string, float)
public void Add(string key, float value)
Parameters
Add(string, string)
public void Add(string key, string value)
Parameters
Append(params Object[])
Returns a JSON object with this object's entries, followed by the first objects's entries, then the second objects's entries, etc.
public JsonData.Object Append(params JsonData.Object[] jsonObjs)
Parameters
jsonObjs
Object[]
Returns
Append(IEnumerable<Object>)
Returns a JSON object with this object's entries, followed by the first objects's entries, then the second objects's entries, etc.
public JsonData.Object Append(IEnumerable<JsonData.Object> jsonObjs)
Parameters
jsonObjs
IEnumerable<JsonData.Object>
Returns
Concat(params Object[])
Combines the JSON objects into one by putting the first object's entries first, then the second object's entries, etc. Returns an empty object if no JSON objects are given.
public static JsonData.Object Concat(params JsonData.Object[] jsonObjs)
Parameters
jsonObjs
Object[]
Returns
Concat(IEnumerable<Object>)
Combines the JSON objects into one by putting the first object's entries first, then the second object's entries, etc. Returns an empty object if no JSON objects are given.
public static JsonData.Object Concat(IEnumerable<JsonData.Object> jsonObjs)
Parameters
jsonObjs
IEnumerable<JsonData.Object>
Returns
Parse(TextReader, bool)
Reads the TextReader, starting at the given index, and attempts to parse it as a JsonData.Object. If successful, the last read character will be the last character of the parsed JSON.
public static JsonData.Object Parse(TextReader reader, bool mustReadAll)
Parameters
reader
TextReadermustReadAll
boolIf true, it will check that all the data in the reader was used when parsing. Setting this to false is useful for parsing JSON data inside a list or object.
Returns
Parse(string)
Attempts to parse the string into a JsonData.Object.
public static JsonData.Object Parse(string str)
Parameters
str
string
Returns
Parse(string, ref int)
Reads the string, starting at the given index, and attempts to parse the string as a JsonData.Object. If successful, the index will be moved to the closing curly bracket.
public static JsonData.Object Parse(string str, ref int index)
Parameters
Returns
ParseMaybeNull(string)
Attempts to parse the string into a JSON object, with the potential to parse it into JsonData.Null.
public static JsonData ParseMaybeNull(string str)
Parameters
str
string
Returns
ParseMaybeNull(string, ref int)
Attempts to parse the string into a JSON object, with the potential to parse it into JsonData.Null. If successful, moves the index to the last parsed character.
public static JsonData ParseMaybeNull(string str, ref int index)
Parameters
Returns
Prepend(params Object[])
Returns a JSON object with the first objects's entries, then the second objects's entries, etc., then this object's entries.
public JsonData.Object Prepend(params JsonData.Object[] jsonObjs)
Parameters
jsonObjs
Object[]
Returns
Prepend(IEnumerable<Object>)
Returns a JSON object with the first objects's entries, then the second objects's entries, etc., then this object's entries.
public JsonData.Object Prepend(IEnumerable<JsonData.Object> jsonObjs)
Parameters
jsonObjs
IEnumerable<JsonData.Object>
Returns
ToJsonString(bool)
Converts it into a string in JSON format.
public string ToJsonString(bool pretty)
Parameters
pretty
boolIf true, puts the string into pretty form - e.g. with indentations.