|
rippled
|
Represents a JSON object being written to a Writer. More...
#include <Object.h>


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. | |
| 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. | |
| Array | setArray (std::string const &key) |
| Make a new Array at a key and return it. | |
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 162 of file Object.cpp.
| Object::Proxy Json::Object::operator[] | ( | std::string const & | key | ) |
Definition at line 113 of file Object.cpp.
| Object::Proxy Json::Object::operator[] | ( | Json::StaticString const & | key | ) |
Definition at line 119 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 68 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 77 of file Object.cpp.
|
protectedinherited |
Definition at line 52 of file Object.cpp.
|
protectedinherited |