Subscript operators
Synopses
Declared in <bdljsn_json.h>
Return a reference providing modifiable access to the element at the specified index in the JsonArray held by this object. The behavior is undefined unless isArray() returns true and index < theArray().size().
Json&
operator[](std::size_t index);
Return a reference providing non‐modifiable access to the element at the specified index in the JsonArray held by this object. The behavior is undefined unless isArray() returns true and index < theArray().size().
Json const&
operator[](std::size_t index) const;
Return a reference providing modifiable access to the Json object associated with the specified key in the JsonObject held by this object. If isNull(), then type is changed to object. If the JsonObject does not already contain a Json object associated with key, first insert a new default‐constructed Json object associated with key. The behavior is undefined unless isObject() or isNull().
Json&
operator[](std::string_view const& key);
Return a reference providing non‐modifiable access to the Json object associated with the specified key in this JsonObject. The behavior is undefined unless key is valid UTF‐8 (see bdlde::Utf8Util::isValid) and this JsonObject already contains a Json object associated with key.
Json const&
operator[](std::string_view const& key) const;
Created with MrDocs