JSONString

JSONString represents a JSON string. Internal representation is escaped for faster parsing and JSON generation.

Constructors

this
this()

The boring default constructor.

this
this(string data)

The ever so slightly more interesting initializing constructor.

Members

Functions

get
string get()

Allow the data to be retreived.

parse
void parse(string source)

This function parses a JSONArray out of a string and eats characters as it goes, hence the ref string parameter.

set
void set(string data)

Allow the data to be set so the object can be reused.

toPrettyString
string toPrettyString(string indent)

A method to convert this JSONString to a formatted, user-readable format.

toString
string toString()

A method to convert this JSONString to a user-readable format.

Variables

_data
string _data;
Undocumented in source.

Inherited Members

From JSONType

toString
string toString()
Undocumented in source.
toPrettyString
string toPrettyString(string indent)
Undocumented in source.
parse
void parse(string source)

The parse method of this interface should ALWAYS be destructive, removing things from the front of source as it parses.

toJSONObject
JSONObject toJSONObject()

Convenience function for casting to JSONObject

toJSONArray
JSONArray toJSONArray()

Convenience function for casting to JSONArray

toJSONString
JSONString toJSONString()

Convenience function for casting to JSONString

toJSONBoolean
JSONBoolean toJSONBoolean()

Convenience function for casting to JSONBoolean

toJSONNumber
JSONNumber toJSONNumber()

Convenience function for casting to JSONNumber

toJSONNull
JSONNull toJSONNull()

Convenience function for casting to JSONNull

opIndex
JSONType opIndex(string key)

Associative array index function for objects describing associative array-like attributes.

opApply
int opApply(int delegate(ref string, ref JSONType) dg)

Allow foreach over the object with string key and ref value.

opIndex
JSONType opIndex(int key)

Array index function for objects describing array-like attributes.

opApply
int opApply(int delegate(ref ulong, ref JSONType) dg)

Allow foreach over the object with integer key and ref value.

opApply
int opApply(int delegate(ref JSONType) dg)

Convenience function for iteration that apply to both AA and array type operations with ref value

opIn_r
JSONType* opIn_r(string key)

Allow "in" operator to work as expected for object types without an explicit cast

Meta