A interface to support Domain Specific Formats for Hjson.
Gets the name of this DSF.
Gets the description of this DSF.
Tries to parse the text as a DSF value.
Stringifies DSF values.
Provides standard DSF providers.
Returns a math DSF provider.
Returns a hex DSF provider.
Returns a date DSF provider.
Options for Save.
Initializes a new instance of this class.
Keep white space and comments.
Show braces at the root level (default true).
Gets or sets DSF providers.
Contains functions to load and save in the Hjson format.
Loads Hjson/JSON from a file.
Loads Hjson/JSON from a file, optionally preserving whitespace and comments.
Loads Hjson/JSON from a stream.
Loads Hjson/JSON from a stream, optionally preserving whitespace and comments.
Loads Hjson/JSON from a TextReader.
Loads Hjson/JSON from a TextReader, optionally preserving whitespace and comments.
Loads Hjson/JSON from a TextReader, preserving whitespace and comments.
Parses the specified Hjson/JSON string.
Parses the specified Hjson/JSON string, optionally preserving whitespace and comments.
Saves Hjson to a file.
Saves Hjson to a stream.
Saves Hjson to a TextWriter.
Loads Hjson/JSON from a file, optionally preserving whitespace and comments.
Loads Hjson/JSON from a stream, optionally preserving whitespace and comments.
Loads Hjson/JSON from a TextReader, optionally preserving whitespace and comments.
Parses the specified Hjson/JSON string, optionally preserving whitespace and comments.
Implements an object value, including whitespace and comments.
Initializes a new instance of this class.
Defines if braces are shown (root object only).
Defines the order of the keys.
Defines a comment for each key. The "" entry is emitted before any element.
Implements an array value, including whitespace and comments.
Initializes a new instance of this class.
Defines a comment for each item. The [0] entry is emitted before any element.
Defines the reader interface.
Triggered when an item for an object is read.
Triggered when an item for an array is read.
Triggered when a value is read.
Implements an array value.
Initializes a new instance of this class.
Initializes a new instance of this class.
Gets the count of the contained items.
Gets or sets the value for the specified index.
The type of this value.
Adds a new item.
Adds a range of items.
Clears the array.
Determines whether the array contains a specific value.
Copies the elements to an System.Array, starting at a particular System.Array index.
Determines the index of a specific item.
Inserts an item.
Removes the specified item.
Removes the item with the specified index.
Implements an object value.
Initializes a new instance of this class.
You can also initialize an object using the C# add syntax: new JsonObject { { "key", "value" }, ... }
M:Hjson.JsonObject.#ctor(System.Collections.Generic.IEnumerable{System.Collections.Generic.KeyValuePair{System.String,Hjson.JsonValue}})
Initializes a new instance of this class.
You can also initialize an object using the C# add syntax: new JsonObject { { "key", "value" }, ... }
Gets the count of the contained items.
Gets or sets the value for the specified key.
The type of this value.
Gets the keys of this object.
Gets the values of this object.
Adds a new item.
You can also initialize an object using the C# add syntax: new JsonObject { { "key", "value" }, ... }
Adds a new item.
M:Hjson.JsonObject.AddRange(System.Collections.Generic.IEnumerable{System.Collections.Generic.KeyValuePair{System.String,Hjson.JsonValue}})
Adds a range of items.
Clears the object.
Determines whether the array contains a specific key.
M:Hjson.JsonObject.CopyTo(System.Collections.Generic.KeyValuePair{System.String,Hjson.JsonValue}[],System.Int32)
Copies the elements to an System.Array, starting at a particular System.Array index.
Removes the item with the specified key.
Name | Description |
---|---|
key: | The key of the element to remove. |
Returns: true if the element is successfully found and removed; otherwise, false. |
Gets the value associated with the specified key.
Implements a primitive value.
Initializes a new string.
Initializes a new char.
Initializes a new bool.
Initializes a new decimal.
Initializes a new double.
Initializes a new float.
Initializes a new long.
Initializes a new int.
Initializes a new byte.
Initializes a new short.
The type of this value.
Defines the known json types.
There is no null type as the primitive will be null instead of the JsonPrimitive containing null.
Json value of type string.
Json value of type number.
Json value of type object.
Json value of type array.
Json value of type boolean.
Json value of an unknown type.
Provides Json extension methods.
For JsonValues with type boolean, this method will return its value as bool, otherwise it will throw.
Gets the value of the member specified by key, then calls [[|M:Hjson.JsonUtil.Qb(Hjson.JsonValue)]]. If the object does not contain the key, the defaultValue is returned.
For JsonValues with type number, this method will return its value as int, otherwise it will throw.
Gets the value of the member specified by key, then calls [[|M:Hjson.JsonUtil.Qi(Hjson.JsonValue)]]. If the object does not contain the key, the defaultValue is returned.
For JsonValues with type number, this method will return its value as long, otherwise it will throw.
Gets the value of the member specified by key, then calls [[|M:Hjson.JsonUtil.Ql(Hjson.JsonValue)]]. If the object does not contain the key, the defaultValue is returned.
For JsonValues with type number, this method will return its value as double, otherwise it will throw.
Gets the value of the member specified by key, then calls [[|M:Hjson.JsonUtil.Qd(Hjson.JsonValue)]]. If the object does not contain the key, the defaultValue is returned.
For JsonValues with type string, this method will return its value as string, otherwise it will throw. Use [[|M:Hjson.JsonUtil.Qstr(Hjson.JsonValue)]] to get a string value from number or boolean types as well.
Gets the value of the member specified by key, then calls [[|M:Hjson.JsonUtil.Qs(Hjson.JsonValue)]]. If the object does not contain the key, the defaultValue is returned.
For JsonValues with type string, number or boolean, this method will return its value as a string (converted if necessary). For arrays or objects it will throw.
Gets the value of the member specified by key, then, for string, number or boolean JsonValues, this method will return its value as a string (converted if necessary).
Gets the JsonValue of the member specified by key.
Gets a JsonObject from a JsonObject.
Gets the JsonObject from a JsonValue.
Gets a JsonArray from a JsonObject.
Gets the JsonArray from a JsonValue.
Enumerates JsonObjects from a JsonObject.
Convert the date to json (unix epoch date offset).
Convert the json date (unix epoch date offset) to a DateTime.
Convert the date to JSON/ISO 8601, compatible with ES5 Date.toJSON().
Use DateTime.Parse() to convert back (will be of local kind).
Convert the date to a precise string representations (ten millionths of a second).
Use DateTime.Parse() to convert back (will be of local kind).
Convert the timespan to JSON/ISO 8601.
The ToString format.
JSON (no whitespace).
Formatted JSON.
Hjson.
JsonValue is the abstract base class for all values (string, number, true, false, null, object or array).
Gets or sets the newline charater(s).
Defaults to Environment.NewLine.
Gets the count of the contained items for arrays/objects.
The type of this value.
Gets or sets the value for the specified index.
Gets or sets the value for the specified key.
Returns true if the object contains the specified key.
Saves the JSON to a file.
Saves the JSON to a stream.
Saves the JSON to a TextWriter.
Saves as Hjson to a string.
Saves the JSON to a string.
Saves the JSON to a string.
Returns the contained primitive value.
Wraps an unknown object into a JSON value (to be used with DSF).
Loads JSON from a file.
Loads JSON from a stream.
Loads JSON from a TextReader.
Parses the specified JSON string.
Converts from bool.
Converts from byte.
Converts from char.
Converts from decimal.
Converts from double.
Converts from float.
Converts from int.
Converts from long.
Converts from short.
Converts from string.
Converts to bool. Also see [[|T:Hjson.JsonUtil]].
Converts to byte. Also see [[|T:Hjson.JsonUtil]].
Converts to char. Also see [[|T:Hjson.JsonUtil]].
Converts to decimal. Also see [[|T:Hjson.JsonUtil]].
Converts to double. Also see [[|T:Hjson.JsonUtil]].
Converts to float. Also see [[|T:Hjson.JsonUtil]].
Converts to int. Also see [[|T:Hjson.JsonUtil]].
Converts to long. Also see [[|T:Hjson.JsonUtil]].
Converts to short. Also see [[|T:Hjson.JsonUtil]].
Converts to string. Also see [[|T:Hjson.JsonUtil]].