JSONValue.boolean

Value getter/setter for boolean stored in JSON.

  1. bool boolean [@property getter]
  2. bool boolean [@property setter]
    struct JSONValue
    @property pure nothrow @safe @nogc
    bool
    boolean
    (
    bool v
    )

Throws

JSONException for read access if this.type is not JSONType.true_ or JSONType.false_.

Examples

JSONValue j = true;
assert(j.boolean == true);

j.boolean = false;
assert(j.boolean == false);

j.integer = 12;
import std.exception : assertThrown;
assertThrown!JSONException(j.boolean);

Meta