ark::serialization::JsonReadOnlyValue

Defined in header “ark/serialization/json_reader.hh”.


A wrapper over a JSON value, allowing you to check the type and get the underlying value out.

Methods

  • JsonReadValueType type()
    Returns the type of this value.

  • bool is_null()
    Returns true if this value is null.

  • std::string as_str()
    Returns the value of this object, as a string.

  • JsonObjectIterator object_iterator()
    Returns an iterator for this object (iterating through object fields).

  • JsonArrayIterator array_iterator()
    Returns an iterator for this array (iterating through array fields).

  • void get_to(Type & destination)
    Retrieves the current value into the given object, throwing if there is a type mismatch that cannot be converted automatically.

  • Type get()
    Retrieves the current value as the given type, throwing if there is a type mismatch that cannot be converted automatically.

  • void get_to(Type & destination)
    Retrieves the current value into the given object, throwing if there is a type mismatch that cannot be converted automatically. Assumes the enum is a string that needs to be converted back.