Constructs a JSONValue from the given raw value.
Alias for a TaggedAlgebraic able to hold all possible JSON value types.
Returns the raw contained value.
Tests if the stored value is of a given type.
Tests if the stored value is of kind Kind.null_.
Constructs a JSONValue from the given raw value.
Enables equality comparisons.
Defines the possible types contained in a JSONValue
Optional location of the corresponding token in the source document.
Holds the data contained in this value.
Shows the basic construction and operations on JSON values.
JSONValue a = 12; JSONValue b = 13; assert(a == 12.0); assert(b == 13.0); assert(a + b == 25.0); auto c = JSONValue([a, b]); assert(c[0] == 12.0); assert(c[1] == 13.0); assert(c[0] == a); assert(c[1] == b); auto d = JSONValue(["a": a, "b": b]); assert(d["a"] == 12.0); assert(d["b"] == 13.0); assert(d["a"] == a); assert(d["b"] == b);
* Represents a generic JSON value. * * The JSONValue type is based on std.variant.Algebraic and as such * provides the usual binary and unary operators for handling the contained * raw value. * * Raw values can be either null, bool, double, string, * JSONValue[] or JSONValue[string].