|
Wt
4.10.4
|
A JSON object. More...
#include <Object.h>
Inherits std::map< K, T >.
Public Member Functions | |
| Object () | |
| Default constructor. | |
| Object (const Object &other) | |
| Copy constructor. | |
| void | swap (Object &other) |
| Swap operation. | |
| Object & | operator= (const Object &other) |
| Assignment operator. | |
| Object (Object &&other) | |
| Move constructor. | |
| Object (std::initializer_list< std::pair< const std::string, Value > > list) | |
| Initializer list constructor. | |
| Object & | operator= (Object &&other) |
| Move assignment operator. | |
| std::set< std::string > | names () const |
| Returns the key set. | |
| bool | contains (const std::string &name) const |
| Returns whether a member exists. | |
| Type | type (const std::string &name) const |
| Returns the type of a given member. | |
| bool | isNull (const std::string &name) const |
| Returns whether the value for a member is null (or not defined). | |
| const Value & | get (const std::string &name) const |
| Returns the value for a member (or null if not defined). | |
Static Public Attributes | |
| static Object | Empty |
| Empty object constant. | |
A JSON object.
This class represents a JSON object, which defines a value map. It is implemented as a std::map<std::string,Json::Value>. It is therefore possible to use the std::map API to deal with it.
However, a number of additional methods have been added to more conveniently query the existence and the type of contained objects. A get() method can be used to return a member value, which returns Value::Null if the member is not defined.
Returns whether a member exists.
This returns whether the name is in the names() set.
Returns the value for a member (or null if not defined).
Returns the value associated with member name or null if no value has been associated with this member name.
Returns whether the value for a member is null (or not defined).
| std::set< std::string > Wt::Json::Object::names | ( | ) | const |
Returns the key set.
This returns the member names: these are the members for which values have been associated in this object.
Swap operation.
This swaps the contents of two objects.
Returns the type of a given member.
This method returns the type of the value for members that are included, or returns Json::Type::Null for when no value is associated with name.