A JSON object. JSON Objects are key : value mappings, similar to dictionaries in Python.
If the same key is added more than once, the latest value wins.
- Todo
- Since key names tend to reuse the same strings, it would be nice to intern the strings here. That's a future optimization for someone.
|
|
| JsonObject () |
| | Create a new JsonObject.
|
| |
| JsonValue * | LookupElementWithIter (JsonPointer::Iterator *iter) |
| | Lookup the Value referred to by the Iterator.
|
| |
|
bool | operator== (const JsonValue &other) const |
| |
| bool | Equals (const JsonObject &other) const |
| | Check if this JsonValue equals a JsonObject.
|
| |
| void | Add (const std::string &key, const std::string &value) |
| | Add a key to string mapping.
|
| |
| void | Add (const std::string &key, const char *value) |
| | Set the given key to a string value.
|
| |
| void | Add (const std::string &key, unsigned int i) |
| | Set the given key to a unsigned int value.
|
| |
| void | Add (const std::string &key, int i) |
| | Set the given key to a int value.
|
| |
| void | Add (const std::string &key, double d) |
| | Set the given key to a double value.
|
| |
| void | Add (const std::string &key, bool value) |
| | Set the given key to a bool value.
|
| |
| void | Add (const std::string &key) |
| | Set the given key to a null value.
|
| |
| JsonObject * | AddObject (const std::string &key) |
| | Set the given key to a JsonObject.
|
| |
| class JsonArray * | AddArray (const std::string &key) |
| | Set the given key to a JsonArray.
|
| |
| void | AddValue (const std::string &key, JsonValue *value) |
| | Set the key to the supplied JsonValue.
|
| |
| void | AddRaw (const std::string &key, const std::string &value) |
| | Set the given key to a raw value.
|
| |
| bool | Remove (const std::string &key) |
| | Remove the JsonValue with the specified key.
|
| |
| bool | ReplaceValue (const std::string &key, JsonValue *value) |
| | Replace the key with the supplied JsonValue.
|
| |
|
void | Accept (JsonValueVisitorInterface *visitor) |
| |
|
void | Accept (JsonValueConstVisitorInterface *visitor) const |
| |
| JsonValue * | Clone () const |
| | Make a copy of this JsonValue.
|
| |
| bool | IsEmpty () const |
| | Check if there are properties within the object.
|
| |
|
unsigned int | Size () const |
| |
| void | VisitProperties (JsonObjectPropertyVisitor *visitor) const |
| | Visit each of the properties in this object.
|
| |
|
virtual JsonValue * | LookupElement (const JsonPointer &pointer) |
| | Locate the JsonValue referred to by the JSON Pointer.
|
| |
| virtual bool | operator== (const JsonValue &other) const =0 |
| | Equality operator.
|
| |
|
virtual bool | operator!= (const JsonValue &other) const |
| | Not-equals operator.
|
| |
| virtual void | Accept (JsonValueVisitorInterface *visitor)=0 |
| | The Accept method for the visitor pattern.
|
| |
| virtual void | Accept (JsonValueConstVisitorInterface *visitor) const =0 |
| | The Accept (const) method for the visitor pattern.
|
| |