AWS IoT Device SDK C++ v2
1.34.0
AWS IoT Device SDK C++ v2
|
#include <JsonObject.h>
Public Member Functions | |
JsonView () | |
JsonView (const JsonObject &val) | |
JsonView & | operator= (const JsonObject &val) |
String | GetString (const String &key) const |
String | GetString (const char *key) const |
String | AsString () const |
bool | GetBool (const String &key) const |
bool | GetBool (const char *key) const |
bool | AsBool () const |
int | GetInteger (const String &key) const |
int | GetInteger (const char *key) const |
int | AsInteger () const |
int64_t | GetInt64 (const String &key) const |
int64_t | GetInt64 (const char *key) const |
int64_t | AsInt64 () const |
double | GetDouble (const String &key) const |
double | GetDouble (const char *key) const |
double | AsDouble () const |
Vector< JsonView > | GetArray (const String &key) const |
Vector< JsonView > | GetArray (const char *key) const |
Vector< JsonView > | AsArray () const |
JsonView | GetJsonObject (const String &key) const |
JsonView | GetJsonObject (const char *key) const |
JsonObject | GetJsonObjectCopy (const String &key) const |
JsonObject | GetJsonObjectCopy (const char *key) const |
JsonView | AsObject () const |
Map< String, JsonView > | GetAllObjects () const |
bool | ValueExists (const String &key) const |
bool | ValueExists (const char *key) const |
bool | KeyExists (const String &key) const |
bool | KeyExists (const char *key) const |
bool | IsObject () const |
bool | IsBool () const |
bool | IsString () const |
bool | IsNumber () const |
bool | IsIntegerType () const |
bool | IsFloatingPointType () const |
bool | IsListType () const |
bool | IsNull () const |
String | WriteCompact (bool treatAsObject=true) const |
String | WriteReadable (bool treatAsObject=true) const |
JsonObject | Materialize () const |
Provides read-only view to an existing JsonObject. This allows lightweight copying without making deep copies of the JsonObject. Note: This class does not extend the lifetime of the given JsonObject. It's your responsibility to ensure the lifetime of the JsonObject is extended beyond the lifetime of its view.
Aws::Crt::JsonView::JsonView | ( | ) |
Aws::Crt::JsonView::JsonView | ( | const JsonObject & | val | ) |
Returns the value of this node as an array of JsonView objects.
bool Aws::Crt::JsonView::AsBool | ( | ) | const |
Returns the value of this node as a boolean.
double Aws::Crt::JsonView::AsDouble | ( | ) | const |
Returns the value of this node as a double precision floating-point.
int64_t Aws::Crt::JsonView::AsInt64 | ( | ) | const |
Returns the value of this node as 64-bit integer.
int Aws::Crt::JsonView::AsInteger | ( | ) | const |
Returns the value of this node as an int.
JsonView Aws::Crt::JsonView::AsObject | ( | ) | const |
Returns the value of this node as a JsonView object.
String Aws::Crt::JsonView::AsString | ( | ) | const |
Returns the value of this node as a string. The behavior is undefined if the node is not of type string.
Reads all json objects at the top level of this node (does not traverse the tree any further) along with their keys.
Gets an array of JsonView objects from this node by its key.
Gets an array of JsonView objects from this node by its key.
bool Aws::Crt::JsonView::GetBool | ( | const char * | key | ) | const |
Gets a boolean value from this node by its key.
bool Aws::Crt::JsonView::GetBool | ( | const String & | key | ) | const |
Gets a boolean value from this node by its key.
double Aws::Crt::JsonView::GetDouble | ( | const char * | key | ) | const |
Gets a double precision floating-point value from this node by its key.
double Aws::Crt::JsonView::GetDouble | ( | const String & | key | ) | const |
Gets a double precision floating-point value from this node by its key.
int64_t Aws::Crt::JsonView::GetInt64 | ( | const char * | key | ) | const |
Gets a 64-bit integer value from this node by its key. The value is 64-bit regardless of the platform/machine.
int64_t Aws::Crt::JsonView::GetInt64 | ( | const String & | key | ) | const |
Gets a 64-bit integer value from this node by its key. The value is 64-bit regardless of the platform/machine.
int Aws::Crt::JsonView::GetInteger | ( | const char * | key | ) | const |
Gets an integer value from this node by its key. The integer is of the same size as an int on the machine.
int Aws::Crt::JsonView::GetInteger | ( | const String & | key | ) | const |
Gets an integer value from this node by its key. The integer is of the same size as an int on the machine.
JsonView Aws::Crt::JsonView::GetJsonObject | ( | const char * | key | ) | const |
Gets a JsonView object from this node by its key.
Gets a JsonView object from this node by its key.
JsonObject Aws::Crt::JsonView::GetJsonObjectCopy | ( | const char * | key | ) | const |
JsonObject Aws::Crt::JsonView::GetJsonObjectCopy | ( | const String & | key | ) | const |
String Aws::Crt::JsonView::GetString | ( | const char * | key | ) | const |
Gets a string from this node by its key.
Gets a string from this node by its key.
bool Aws::Crt::JsonView::IsBool | ( | ) | const |
Tests whether the current value is a boolean.
bool Aws::Crt::JsonView::IsFloatingPointType | ( | ) | const |
Tests whether the current value is a number that will lose precision if converted to an int64_t.
bool Aws::Crt::JsonView::IsIntegerType | ( | ) | const |
Tests whether the current value is a number that can convert to an int64_t without losing precision.
bool Aws::Crt::JsonView::IsListType | ( | ) | const |
Tests whether the current value is a JSON array.
bool Aws::Crt::JsonView::IsNull | ( | ) | const |
Tests whether the current value is a JSON null.
bool Aws::Crt::JsonView::IsNumber | ( | ) | const |
Tests whether the current value is a number.
bool Aws::Crt::JsonView::IsObject | ( | ) | const |
Tests whether the current value is a JSON object.
bool Aws::Crt::JsonView::IsString | ( | ) | const |
Tests whether the current value is a string.
bool Aws::Crt::JsonView::KeyExists | ( | const char * | key | ) | const |
Tests whether a key exists at the current node level.
bool Aws::Crt::JsonView::KeyExists | ( | const String & | key | ) | const |
Tests whether a key exists at the current node level.
JsonObject Aws::Crt::JsonView::Materialize | ( | ) | const |
Creates a deep copy of the JSON value rooted in the current JSON view.
JsonView & Aws::Crt::JsonView::operator= | ( | const JsonObject & | val | ) |
bool Aws::Crt::JsonView::ValueExists | ( | const char * | key | ) | const |
Tests whether a value exists at the current node level for the given key. Returns true if a value has been found and its value is not null, false otherwise.
bool Aws::Crt::JsonView::ValueExists | ( | const String & | key | ) | const |
Tests whether a value exists at the current node level for the given key. Returns true if a value has been found and its value is not null, false otherwise.
String Aws::Crt::JsonView::WriteCompact | ( | bool | treatAsObject = true | ) | const |
Writes the current JSON view without whitespace characters starting at the current level to a string.
treatAsObject | if the current value is empty, writes out '{}' rather than an empty string. |
String Aws::Crt::JsonView::WriteReadable | ( | bool | treatAsObject = true | ) | const |
Writes the current JSON view to a string in a human friendly format.
treatAsObject | if the current value is empty, writes out '{}' rather than an empty string. |