Table of Contents

Class JsonData.Object

Namespace
PAC.Json

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

key string
value JsonData.Bool

Add(string, Float)

public void Add(string key, JsonData.Float value)

Parameters

key string
value JsonData.Float

Add(string, Int)

public void Add(string key, JsonData.Int value)

Parameters

key string
value JsonData.Int

Add(string, List)

public void Add(string key, JsonData.List value)

Parameters

key string
value JsonData.List

Add(string, Null)

public void Add(string key, JsonData.Null value)

Parameters

key string
value JsonData.Null

Add(string, Object)

public void Add(string key, JsonData.Object value)

Parameters

key string
value JsonData.Object

Add(string, String)

public void Add(string key, JsonData.String value)

Parameters

key string
value JsonData.String

Add(string, bool)

public void Add(string key, bool value)

Parameters

key string
value bool

Add(string, int)

public void Add(string key, int value)

Parameters

key string
value int

Add(string, float)

public void Add(string key, float value)

Parameters

key string
value float

Add(string, string)

public void Add(string key, string value)

Parameters

key string
value string

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

JsonData.Object

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

JsonData.Object

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

JsonData.Object

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

JsonData.Object

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 TextReader
mustReadAll bool

If 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

JsonData.Object

Parse(string)

Attempts to parse the string into a JsonData.Object.

public static JsonData.Object Parse(string str)

Parameters

str string

Returns

JsonData.Object

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

str string
index int

Returns

JsonData.Object

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

JsonData

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

str string
index int

Returns

JsonData

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

JsonData.Object

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

JsonData.Object

ToJsonString(bool)

Converts it into a string in JSON format.

public string ToJsonString(bool pretty)

Parameters

pretty bool

If true, puts the string into pretty form - e.g. with indentations.

Returns

string