Function get_object_value

Synopsis

#include <include/sajson.h>

value get_object_value(size_t index) const

Description

Returns the nth value of an object. Calling with an out-of-bound index is undefined behavior. Only legal if get_type() is TYPE_OBJECT.

Mentioned in

Source

Lines 535-543 in include/sajson.h.

value get_object_value(size_t index) const {
    using namespace internal;
    assert_tag(tag::object);
    size_t element = payload[3 + index * 3];
    return value(
        get_element_tag(element),
        payload + get_element_value(element),
        text);
}





Add Discussion as Guest

Log in