Lines Matching refs:JSONValue

32     JSONValue j = parseJSON(s);
40 if (const(JSONValue)* code = "code" in j) variable
49 JSONValue jj = [ "language": "D" ];
51 jj.object["rating"] = JSONValue(3.5);
53 jj.object["list"] = JSONValue( ["a", "b", "c"] );
55 jj["list"].array ~= JSONValue("D");
118 struct JSONValue struct
128 JSONValue[string] object; argument
129 JSONValue[] array;
145 JSONValue j = parseJSON(s); argument
170 JSONValue j = [ "language": "D" ];
256 JSONValue j = true;
278 @property ref inout(JSONValue[string]) object() inout pure @system return
285 …@property JSONValue[string] object(return scope JSONValue[string] v) pure nothrow @nogc @trusted /…
306 @property inout(JSONValue[string]) objectNoRef() inout pure @trusted
324 @property ref inout(JSONValue[]) array() scope return inout pure @system
331 …@property JSONValue[] array(return scope JSONValue[] v) pure nothrow @nogc @trusted scope // TODO …
353 @property inout(JSONValue[]) arrayNoRef() inout pure @trusted
415 @property inout(T) get(T : JSONValue[])() inout pure @trusted /// ditto
420 @property inout(T) get(T : JSONValue[string])() inout pure @trusted
451 assertNotThrown(json["e"].get!(JSONValue[]));
452 assertNotThrown(json["f"].get!(JSONValue[string]));
455 assertThrown!JSONException(json["d"].get!(JSONValue[string]));
456 assertThrown!JSONException(json["f"].get!(JSONValue[]));
509 static if (is(Value : JSONValue))
511 JSONValue[string] t = arg;
516 JSONValue[string] aa;
518 aa[key] = JSONValue(value);
525 static if (is(ElementEncodingType!T : JSONValue))
527 JSONValue[] t = arg;
532 JSONValue[] new_arg = new JSONValue[arg.length];
534 new_arg[i] = JSONValue(e);
538 else static if (is(T : JSONValue))
552 static if (is(ElementEncodingType!T : JSONValue))
558 JSONValue[] new_arg = new JSONValue[arg.length];
560 new_arg[i] = JSONValue(e);
587 this(T : JSONValue)(inout T arg) inout
595 JSONValue j = JSONValue( "a string" );
596 j = JSONValue(42);
598 j = JSONValue( [1, 2, 3] );
601 j = JSONValue( ["language": "D"] );
605 void opAssign(T)(T arg) if (!isStaticArray!T && !is(T : JSONValue))
619 ref inout(JSONValue) opIndex(size_t i) inout pure @safe
629 JSONValue j = JSONValue( [42, 43, 44] );
638 ref inout(JSONValue) opIndex(return scope string k) inout pure @safe
647 JSONValue j = JSONValue( ["language": "D"] );
664 JSONValue[string] aa = null;
676 JSONValue j = JSONValue( ["language": "D"] );
692 JSONValue j = JSONValue( ["Perl", "C"] );
697 JSONValue opBinary(string op : "~", T)(T arg)
702 return JSONValue(a ~ JSONValue(arg).arrayNoRef);
704 else static if (is(T : JSONValue))
706 return JSONValue(a ~ arg.arrayNoRef);
719 a ~= JSONValue(arg).arrayNoRef;
721 else static if (is(T : JSONValue))
744 inout(JSONValue)* opBinaryRight(string op : "in")(string k) inout @safe
751 JSONValue j = [ "language": "D", "author": "walter" ];
757 bool opEquals(const JSONValue rhs) const @nogc nothrow pure @safe
762 bool opEquals(ref const JSONValue rhs) const @nogc nothrow pure @trusted
822 assert(JSONValue(0u) == JSONValue(0));
823 assert(JSONValue(0u) == JSONValue(0.0));
824 assert(JSONValue(0) == JSONValue(0.0));
828 int opApply(scope int delegate(size_t index, ref JSONValue) dg) @system
843 int opApply(scope int delegate(string key, ref JSONValue) dg) @system
904 public JSONValue asJSON() const @system { return JSONValue.init; }
910 JSONValue json;
931 JSONValue parseJSON(T)(T json, int maxDepth = -1, JSONOptions options = JSONOptions.none)
936 JSONValue root;
1179 void parseValue(ref JSONValue value)
1196 JSONValue[string] obj;
1207 JSONValue member;
1224 JSONValue[] arr;
1232 JSONValue element;
1439 JSONValue parseJSON(T)(T json, JSONOptions options)
1454 string toJSON(const ref JSONValue root, in bool pretty = false, in JSONOptions options = JSONOption…
1464 const ref JSONValue root,
1545 void delegate(ref const JSONValue, ulong) @safe toValue;
1549 void delegate(ref const JSONValue, ulong) @system toValue;
1552 void toValueImpl(ref const JSONValue value, ulong indentLevel)
1721 JSONValue jv0 = JSONValue("test测试");
1723 JSONValue jv00 = JSONValue("test\u6D4B\u8BD5");
1726 JSONValue jv1 = JSONValue("été");
1728 JSONValue jv11 = JSONValue("\u00E9t\u00E9");
1740 .formattedWrite!"%s"(JSONValue.init);
1752 JSONValue j = parseJSON(s);
1766 auto jv1 = JSONValue(4.0);
1783 JSONValue j;
1821 JSONValue jv = "123";
1857 static assert(is(typeof(value) == JSONValue));
1870 static assert(is(typeof(value) == JSONValue));
1882 jv = JSONValue("value");
1886 JSONValue jv2 = JSONValue("value");
1890 JSONValue jv3 = JSONValue("\u001c");
1898 JSONValue jv = 1;
1917 jv.object = ["key" : JSONValue("value")];
1919 assert(jv.object == ["key" : JSONValue("value")]);
1921 jv.array = [JSONValue(1), JSONValue(2), JSONValue(3)];
1923 assert(jv.array == [JSONValue(1), JSONValue(2), JSONValue(3)]);
1940 JSONValue jarr = JSONValue([10]);
1942 jarr.array ~= JSONValue(i);
1945 JSONValue jobj = JSONValue(["key" : JSONValue("value")]);
1947 jobj.object[text("key", i)] = JSONValue(text("value", i));
1955 JSONValue jarr = JSONValue([10]);
1957 jarr ~= [JSONValue(i)];
1960 JSONValue jobj = JSONValue(["key" : JSONValue("value")]);
1962 jobj[text("key", i)] = JSONValue(text("value", i));
1968 assert(jarr[0] == JSONValue(10));
2006 JSONValue val;
2071 JSONValue jv;
2128 assert(JSONValue(float.nan).toString(JSONOptions.specialFloatLiterals) == nanString);
2129 assert(JSONValue(double.infinity).toString(JSONOptions.specialFloatLiterals) == infString);
2130 …assert(JSONValue(-real.infinity).toString(JSONOptions.specialFloatLiterals) == negativeInfString);
2133 assertThrown!JSONException(JSONValue(float.nan).toString);
2134 assertThrown!JSONException(JSONValue(double.infinity).toString);
2135 assertThrown!JSONException(JSONValue(-real.infinity).toString);
2138 JSONValue jvNan = parseJSON(nanString, JSONOptions.specialFloatLiterals);
2139 JSONValue jvInf = parseJSON(infString, JSONOptions.specialFloatLiterals);
2140 JSONValue jvNegInf = parseJSON(negativeInfString, JSONOptions.specialFloatLiterals);
2158 JSONValue testVal;
2163 testVal = (JSONValue[string]).init;
2164 testVal = JSONValue[].init;
2175 JSONValue testVal = a;
2193 const json0 = JSONValue(num0);
2231 auto v = JSONValue("\U0001D11E");
2254 auto v = JSONValue("\xFF");
2351 JSONValue j = parseJSON(s);
2364 JSONValue j = parseJSON(s);
2378 JSONValue j = parseJSON(s);
2400 JSONValue j = parseJSON(s);