aws-crt-cpp
C++ wrapper around the aws-c-* libraries. Provides Cross-Platform Transport Protocols and SSL/TLS implementations for C++.
|
#include <JsonObject.h>
Public Member Functions | |
JsonObject () | |
JsonObject (const String &value) | |
JsonObject (const JsonObject &value) | |
JsonObject (JsonObject &&value) noexcept | |
~JsonObject () | |
JsonObject & | operator= (const JsonObject &other) |
JsonObject & | operator= (JsonObject &&other) noexcept |
bool | operator== (const JsonObject &other) const |
bool | operator!= (const JsonObject &other) const |
JsonObject & | WithString (const String &key, const String &value) |
JsonObject & | WithString (const char *key, const String &value) |
JsonObject & | AsString (const String &value) |
JsonObject & | WithBool (const String &key, bool value) |
JsonObject & | WithBool (const char *key, bool value) |
JsonObject & | AsBool (bool value) |
JsonObject & | WithInteger (const String &key, int value) |
JsonObject & | WithInteger (const char *key, int value) |
JsonObject & | AsInteger (int value) |
JsonObject & | WithInt64 (const String &key, int64_t value) |
JsonObject & | WithInt64 (const char *key, int64_t value) |
JsonObject & | AsInt64 (int64_t value) |
JsonObject & | WithDouble (const String &key, double value) |
JsonObject & | WithDouble (const char *key, double value) |
JsonObject & | AsDouble (double value) |
JsonObject & | WithArray (const String &key, const Vector< String > &array) |
JsonObject & | WithArray (const char *key, const Vector< String > &array) |
JsonObject & | WithArray (const String &key, const Vector< JsonObject > &array) |
JsonObject & | WithArray (const String &key, Vector< JsonObject > &&array) |
JsonObject & | AsArray (const Vector< JsonObject > &array) |
JsonObject & | AsArray (Vector< JsonObject > &&array) |
JsonObject & | AsNull () |
JsonObject & | WithObject (const String &key, const JsonObject &value) |
JsonObject & | WithObject (const char *key, const JsonObject &value) |
JsonObject & | WithObject (const String &key, JsonObject &&value) |
JsonObject & | WithObject (const char *key, JsonObject &&value) |
JsonObject & | AsObject (const JsonObject &value) |
JsonObject & | AsObject (JsonObject &&value) |
bool | WasParseSuccessful () const |
const String & | GetErrorMessage () const |
JsonView | View () const |
Friends | |
class | JsonView |
JSON DOM manipulation class. To read or serialize use View function.
Aws::Crt::JsonObject::JsonObject | ( | ) |
Constructs empty JSON DOM.
Aws::Crt::JsonObject::JsonObject | ( | const String & | value | ) |
Constructs a JSON DOM by parsing the input string.
Aws::Crt::JsonObject::JsonObject | ( | const JsonObject & | value | ) |
Performs a deep copy of the JSON DOM parameter. Prefer using a JsonView if copying is not needed.
|
noexcept |
Moves the ownership of the internal JSON DOM. No copying is performed.
Aws::Crt::JsonObject::~JsonObject | ( | ) |
JsonObject & Aws::Crt::JsonObject::AsArray | ( | const Vector< JsonObject > & | array | ) |
Converts the current JSON node to an array whose values are deep-copied from the array parameter.
JsonObject & Aws::Crt::JsonObject::AsArray | ( | Vector< JsonObject > && | array | ) |
Converts the current JSON node to an array whose values are moved from the array parameter.
JsonObject & Aws::Crt::JsonObject::AsBool | ( | bool | value | ) |
Converts the current JSON node to a bool.
JsonObject & Aws::Crt::JsonObject::AsDouble | ( | double | value | ) |
Converts the current JSON node to a double.
JsonObject & Aws::Crt::JsonObject::AsInt64 | ( | int64_t | value | ) |
Converts the current JSON node to a 64-bit integer.
JsonObject & Aws::Crt::JsonObject::AsInteger | ( | int | value | ) |
Converts the current JSON node to an integer.
JsonObject & Aws::Crt::JsonObject::AsNull | ( | ) |
Sets the current JSON node as null.
JsonObject & Aws::Crt::JsonObject::AsObject | ( | const JsonObject & | value | ) |
Converts the current JSON node to a JSON object by deep-copying the parameter.
JsonObject & Aws::Crt::JsonObject::AsObject | ( | JsonObject && | value | ) |
Converts the current JSON node to a JSON object by moving from the parameter.
JsonObject & Aws::Crt::JsonObject::AsString | ( | const String & | value | ) |
Converts the current JSON node to a string.
|
inline |
Returns the last error message from a failed parse attempt. Returns empty string if no error.
bool Aws::Crt::JsonObject::operator!= | ( | const JsonObject & | other | ) | const |
JsonObject & Aws::Crt::JsonObject::operator= | ( | const JsonObject & | other | ) |
Performs a deep copy of the JSON DOM parameter.
|
noexcept |
Moves the ownership of the internal JSON DOM of the parameter to the current object. No copying is performed. A DOM currently owned by the object will be freed prior to copying.
bool Aws::Crt::JsonObject::operator== | ( | const JsonObject & | other | ) | const |
JsonView Aws::Crt::JsonObject::View | ( | ) | const |
Creates a view from the current root JSON node.
|
inline |
Returns true if the last parse request was successful. If this returns false, you can call GetErrorMessage() to find the cause.
JsonObject & Aws::Crt::JsonObject::WithArray | ( | const char * | key, |
const Vector< String > & | array | ||
) |
JsonObject & Aws::Crt::JsonObject::WithArray | ( | const String & | key, |
const Vector< JsonObject > & | array | ||
) |
Adds an array of arbitrary JSON objects to the top level of this node at key. The values in the array parameter will be deep-copied.
JsonObject & Aws::Crt::JsonObject::WithArray | ( | const String & | key, |
const Vector< String > & | array | ||
) |
Adds an array of strings to the top level of this node at key.
JsonObject & Aws::Crt::JsonObject::WithArray | ( | const String & | key, |
Vector< JsonObject > && | array | ||
) |
Adds an array of arbitrary JSON objects to the top level of this node at key. The values in the array parameter will be moved-from.
JsonObject & Aws::Crt::JsonObject::WithBool | ( | const char * | key, |
bool | value | ||
) |
JsonObject & Aws::Crt::JsonObject::WithBool | ( | const String & | key, |
bool | value | ||
) |
Adds a bool value with key to the top level of this node.
JsonObject & Aws::Crt::JsonObject::WithDouble | ( | const char * | key, |
double | value | ||
) |
JsonObject & Aws::Crt::JsonObject::WithDouble | ( | const String & | key, |
double | value | ||
) |
Adds a double value at key at the top level of this node.
JsonObject & Aws::Crt::JsonObject::WithInt64 | ( | const char * | key, |
int64_t | value | ||
) |
JsonObject & Aws::Crt::JsonObject::WithInt64 | ( | const String & | key, |
int64_t | value | ||
) |
Adds a 64-bit integer value at key to the top level of this node.
JsonObject & Aws::Crt::JsonObject::WithInteger | ( | const char * | key, |
int | value | ||
) |
JsonObject & Aws::Crt::JsonObject::WithInteger | ( | const String & | key, |
int | value | ||
) |
Adds an integer value at key at the top level of this node.
JsonObject & Aws::Crt::JsonObject::WithObject | ( | const char * | key, |
const JsonObject & | value | ||
) |
JsonObject & Aws::Crt::JsonObject::WithObject | ( | const char * | key, |
JsonObject && | value | ||
) |
JsonObject & Aws::Crt::JsonObject::WithObject | ( | const String & | key, |
const JsonObject & | value | ||
) |
Adds a JSON object to the top level of this node at key. The object parameter is deep-copied.
JsonObject & Aws::Crt::JsonObject::WithObject | ( | const String & | key, |
JsonObject && | value | ||
) |
Adds a JSON object to the top level of this node at key.
JsonObject & Aws::Crt::JsonObject::WithString | ( | const char * | key, |
const String & | value | ||
) |
JsonObject & Aws::Crt::JsonObject::WithString | ( | const String & | key, |
const String & | value | ||
) |
Adds a string to the top level of this node with key.
|
friend |