aws-crt-cpp
C++ wrapper around the aws-c-* libraries. Provides Cross-Platform Transport Protocols and SSL/TLS implementations for C++.
|
#include <JsonObject.h>
Friends | |
class | JsonView |
class | ApiHandle |
JSON DOM manipulation class. To read or serialize use View function.
Aws::Crt::JsonObject::JsonObject | ( | ) |
Constructs empty JSON DOM.
Constructs a JSON DOM by parsing the input string. Call WasParseSuccessful() on new object to determine if parse was successful.
Aws::Crt::JsonObject::JsonObject | ( | const JsonObject & | other | ) |
Construct a deep copy. Prefer using a JsonView if copying is not needed.
|
noexcept |
Move constructor. 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 number.
JsonObject & Aws::Crt::JsonObject::AsInt64 | ( | int64_t | value | ) |
Converts the current JSON node to a number. Precision may be lost.
JsonObject & Aws::Crt::JsonObject::AsInteger | ( | int | value | ) |
Converts the current JSON node to a number. Precision may be lost.
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.
bool Aws::Crt::JsonObject::operator!= | ( | const JsonObject & | other | ) | const |
JsonObject & Aws::Crt::JsonObject::operator= | ( | const JsonObject & | other | ) |
Performs a deep copy.
|
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 of this JSON node.
|
inline |
Returns true if the last parse request was successful.
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.
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 number 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 number value at key to the top level of this node. Precision may be lost.
JsonObject & Aws::Crt::JsonObject::WithInteger | ( | const char * | key, |
int | value | ||
) |
JsonObject & Aws::Crt::JsonObject::WithInteger | ( | const String & | key, |
int | value | ||
) |
Adds a number value at key at the top level of this node. Precision may be lost.
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.