JSONNumber

JSONNumber represents any JSON numeric value.

Constructors

this
this()

Another boring constructor...

this
this(real data)

...and its slightly less boring sibling.

this
this(long data)
Undocumented in source.
this
this(int data)
Undocumented in source.

Members

Functions

get
real get()

Allow the number to be retreived.

getLong
long getLong()
Undocumented in source. Be warned that the author may not have intended to support it.
getReal
real getReal()
Undocumented in source. Be warned that the author may not have intended to support it.
parse
void parse(string source)

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

set
void set(real data)

Allow setting of the hidden number.

set
void set(long data)
Undocumented in source. Be warned that the author may not have intended to support it.
set
void set(int data)
Undocumented in source. Be warned that the author may not have intended to support it.
toPrettyString
string toPrettyString(string indent)

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

toString
string toString()

A method to convert this JSONNumber 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