The OpenD Programming Language

JSONValue.boolean

Value getter/setter for boolean stored in JSON.

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

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