readJSON

Read an entire string into a JSON tree.

readJSON
(
string src
)

Return Value

Type: JSONType

A JSONObject with no name that is the root of the document that was read.

Throws

JSONError on any parsing errors.

Examples

auto root = new JSONObject();
auto arr = new JSONArray();
arr ~= new JSONString("da blue teeths!\"\\");
root["what is that on your ear?"] = arr;
root["my pants"] = new JSONString("are on fire");
root["i am this many"] = new JSONNumber(10.253);
string jstr = root.toString;
writef("Unit Test libDJSON JSON creation...\n");
writef("Generated JSON string: ");writef(jstr);writef("\n");
writef("Regenerated JSON string: ");writef(readJSON(jstr).toString);writef("\n");

Meta