msgraph.graph.jsonhelper
JSON Helpers
License:
BSL-1.0.
- enum Ignore
ignore
; - Attribute marking
ignore
data - enum Essential
essential
; - Attribute marking
essential
field - pure nothrow @nogc @safe Name
name
(stringname
);
enum Namename
(string n); - Attribute forcing field
name
- alias
convBy
= ConvBy(alias T); - template
convertTo
(alias value) - template
convertFrom
(alias value) - @property JSONValue
json
(T)(auto const ref T[] x)
if(isSomeString!(T[]));
@property JSONValuejson
(T)(auto const ref T x)
if(isIntegral!T && !is(T == enum) || isFloatingPoint!T || is(Unqual!T == bool));
@property JSONValuejson
(T)(auto const ref T x)
if(is(T == enum));
@property JSONValuejson
(T)(auto const ref T[] ary)
if(!isSomeString!(T[]) && isArray!(T[]));
@property JSONValuejson
(Value, Key)(auto const ref Value[Key] aa)
if(isSomeString!Key && is(typeof(() { auto v = Value.init.json
; } )));
@property JSONValuejson
(JV)(auto const ref JV v)
if(is(JV : const(JSONValue))); - Get data from JSONValue
- pure nothrow @trusted void
setValue
(T)(ref JSONValue v, string name, T val); - Operation of JSONValue
- bool
fromJson
(T)(in ref JSONValue src, ref T dst)
if(isSomeString!T);
boolfromJson
(T)(in ref JSONValue src, ref T dst)
if(isIntegral!T && !is(T == enum));
boolfromJson
(T)(in ref JSONValue src, ref T dst)
if(isFloatingPoint!T);
boolfromJson
(T)(in ref JSONValue src, ref T dst)
if(is(T == struct) && !is(Unqual!T : JSONValue));
boolfromJson
(T)(in ref JSONValue src, ref T dst)
if(is(T == class));
boolfromJson
(T)(in ref JSONValue src, ref T dst)
if(is(T == enum));
boolfromJson
(T)(in ref JSONValue src, ref T dst)
if(is(T == bool));
boolfromJson
(T)(in ref JSONValue src, ref T dst)
if(!isSomeString!T && isDynamicArray!T);
boolfromJson
(Value, Key)(in ref JSONValue src, ref Value[Key] dst)
if(isSomeString!Key && is(typeof(() { JSONValue val; cast(void)fromJson
(val, dst[Key.init]); } )));
boolfromJson
(T)(in ref JSONValue src, ref T dst)
if(is(Unqual!T == JSONValue)); - pure nothrow @trusted T
getValue
(T)(in ref JSONValue v, string name, lazy scope T defaultVal = T.init); - struct
AttrConverter
(T); -
- T function(in JSONValue v)
from
; - JSONValue function(in T v)
to
;
- AttrConverter!T
converter
(T)(T function(in JSONValue) from, JSONValue function(in T) to); - Attribute converting method
- JSONValue
serializeToJson
(T)(in T data);
stringserializeToJsonString
(T)(in T data, JSONOptions options = JSONOptions.none); - serialize data to JSON
- void
deserializeFromJson
(T)(ref T data, in JSONValue json);
voiddeserializeFromJsonString
(T)(ref T data, string jsonContents); - deserialize data from JSON