Construct a json instance, with a default value of null
use these types for external references
enumerates the seven acceptable JSON value types
Create an array of values
Create a composite from zero or more pairs, and return as a value
Create an attribute/value pair, where value defaults to null
Parse the given text and return a resultant Value type. Also sets the document value.
Return a text representation of this document
Returns the root value of this document
Set the root value of this document
Create a text value
Create a boolean value
Create a numeric value
Create a single Value from an array of Values
Represents a single json Object (a composite of named attribute/value pairs).
Represents a json value that is one of the seven types specified via the Json.Type enum
Represents an attribute/value pair. Aliased as Attribute
Parse json text into a set of inter-related structures. Typical usage is as follows:
Converting back to text format employs a delegate. This one emits document content to the console:
Constructing json within your code leverages a handful of factories within a document instance. This example creates a document from an array of values:
Setting the document to contain a simple object instead:
Objects may be constructed with multiple attribute pairs like so:
Substitute arrays, or other objects as values where appropriate:
TODO: document how to extract content
Big thanks to dhasenan for suggesting the construction notation. We can't make effective use of operator-overloading, due to the use of struct pointers, so this syntax turned out to be the next best thing.