![]() |
CMSC23740 Common Code Library
Support code for CS23740 programming projects
|
JSON objects. More...
#include <json.hpp>


Public Member Functions | |
| Object () | |
| ~Object () | |
| int | size () const |
| return the number of fields in the object | |
| void | insert (std::string key, Value *val) |
| insert a key-value pair into the object | |
| Value * | operator[] (std::string key) const |
| const Object * | fieldAsObject (std::string key) const |
| const Array * | fieldAsArray (std::string key) const |
| const Number * | fieldAsNumber (std::string key) const |
| const Integer * | fieldAsInteger (std::string key) const |
| const Real * | fieldAsReal (std::string key) const |
| const String * | fieldAsString (std::string key) const |
| const Bool * | fieldAsBool (std::string key) const |
| std::string | toString () |
| Public Member Functions inherited from json::Value | |
| Type | type () const |
| return the type of this JSON value | |
| bool | isObject () const |
| return true if this value is an object | |
| bool | isArray () const |
| return true if this value is an array | |
| bool | isNumber () const |
| return true if this value is a number | |
| bool | isInteger () const |
| return true if this value is an integer | |
| bool | isReal () const |
| return true if this value is a real number | |
| bool | isString () const |
| return true if this value is a string | |
| bool | isBool () const |
| return true if this value is a boolean | |
| bool | isNull () const |
| return true if this value is the null value | |
| const Object * | asObject () const |
| dynamic cast to JSON object | |
| const Array * | asArray () const |
| dynamic cast to JSON array | |
| const Number * | asNumber () const |
| dynamic cast to JSON number | |
| const Integer * | asInteger () const |
| dynamic cast to JSON integer | |
| const Real * | asReal () const |
| dynamic cast to JSON real number | |
| const String * | asString () const |
| dynamic cast to JSON string | |
| const Bool * | asBool () const |
| dynamic cast to JSON boolean | |
| virtual | ~Value () |
Additional Inherited Members | |
| Protected Member Functions inherited from json::Value | |
| Value (Type ty) | |
| Protected Attributes inherited from json::Value | |
| Type | _ty |
JSON objects.
|
inline |
| json::Object::~Object | ( | ) |
|
inline |
return an array-valued field
|
inline |
return an bool-valued field
|
inline |
return an integer-valued field
|
inline |
return a number-valued field
|
inline |
return an object-valued field
|
inline |
return an real-valued field
|
inline |
return an string-valued field
| void json::Object::insert | ( | std::string | key, |
| Value * | val ) |
insert a key-value pair into the object
| Value * json::Object::operator[] | ( | std::string | key | ) | const |
return the value corresponding to the given key.
|
inline |
return the number of fields in the object
|
virtual |
Implements json::Value.