rippled
|
Represents a JSON object being written to a Writer. More...
Classes | |
class | Proxy |
class | Root |
Public Member Functions | |
template<typename Scalar > | |
void | set (std::string const &key, Scalar const &) |
Set a scalar value in the Object for a key. More... | |
void | set (std::string const &key, Json::Value const &) |
Proxy | operator[] (std::string const &key) |
Proxy | operator[] (Json::StaticString const &key) |
Object | setObject (std::string const &key) |
Make a new Object at a key and return it. More... | |
Array | setArray (std::string const &key) |
Make a new Array at a key and return it. More... | |
Protected Member Functions | |
Object (Collection *parent, Writer *w) | |
void | checkWritable (std::string const &label) |
Protected Attributes | |
Collection * | parent_ |
Writer * | writer_ |
bool | enabled_ |
Friends | |
class | Array |
|
protected |
void Json::Object::set | ( | std::string const & | key, |
Scalar const & | value | ||
) |
Set a scalar value in the Object for a key.
A JSON scalar is a single value - a number, string, boolean, nullptr or a Json::Value.
set()
throws an exception if this object is disabled (which means that one of its children is enabled).
In a debug build, set()
also throws an exception if the key has already been set() before.
An operator[] is provided to allow writing object["key"] = scalar;
.
void Json::Object::set | ( | std::string const & | key, |
Json::Value const & | v | ||
) |
Definition at line 175 of file Object.cpp.
Object::Proxy Json::Object::operator[] | ( | std::string const & | key | ) |
Definition at line 126 of file Object.cpp.
Object::Proxy Json::Object::operator[] | ( | Json::StaticString const & | key | ) |
Definition at line 132 of file Object.cpp.
Object Json::Object::setObject | ( | std::string const & | key | ) |
Make a new Object at a key and return it.
This Object is disabled until that sub-object is destroyed. Throws an exception if this Object was already disabled.
Definition at line 81 of file Object.cpp.
Array Json::Object::setArray | ( | std::string const & | key | ) |
Make a new Array at a key and return it.
This Object is disabled until that sub-array is destroyed. Throws an exception if this Object was already disabled.
Definition at line 90 of file Object.cpp.
|
protectedinherited |
Definition at line 65 of file Object.cpp.
|
protectedinherited |