AWS SDK for C++  1.7.233
AWS SDK for C++
Public Member Functions | List of all members
Aws::Utils::Json::JsonView Class Reference

#include <JsonSerializer.h>

Public Member Functions

 JsonView ()
 
 JsonView (const JsonValue &v)
 
JsonViewoperator= (const JsonValue &v)
 
Aws::String GetString (const Aws::String &key) const
 
Aws::String AsString () const
 
bool GetBool (const Aws::String &key) const
 
bool AsBool () const
 
int GetInteger (const Aws::String &key) const
 
int AsInteger () const
 
int64_t GetInt64 (const Aws::String &key) const
 
int64_t AsInt64 () const
 
double GetDouble (const Aws::String &key) const
 
double AsDouble () const
 
Array< JsonViewGetArray (const Aws::String &key) const
 
Array< JsonViewAsArray () const
 
JsonView GetObject (const Aws::String &key) const
 
JsonView AsObject () const
 
Aws::Map< Aws::String, JsonViewGetAllObjects () const
 
bool ValueExists (const Aws::String &key) const
 
bool KeyExists (const Aws::String &key) const
 
bool IsObject () const
 
bool IsBool () const
 
bool IsString () const
 
bool IsIntegerType () const
 
bool IsFloatingPointType () const
 
bool IsListType () const
 
bool IsNull () const
 
Aws::String WriteCompact (bool treatAsObject=true) const
 
Aws::String WriteReadable (bool treatAsObject=true) const
 
JsonValue Materialize () const
 

Detailed Description

Provides read-only view to an existing JsonValue. This allows lightweight copying without making deep copies of the JsonValue. Note: This class does not extend the lifetime of the given JsonValue. It's your responsibility to ensure the lifetime of the JsonValue is extended beyond the lifetime of its view.

Definition at line 231 of file JsonSerializer.h.

Constructor & Destructor Documentation

◆ JsonView() [1/2]

Aws::Utils::Json::JsonView::JsonView ( )

◆ JsonView() [2/2]

Aws::Utils::Json::JsonView::JsonView ( const JsonValue v)

Member Function Documentation

◆ AsArray()

Array<JsonView> Aws::Utils::Json::JsonView::AsArray ( ) const

Returns the value of this node as an array of JsonView objects.

◆ AsBool()

bool Aws::Utils::Json::JsonView::AsBool ( ) const

Returns the value of this node as a boolean.

◆ AsDouble()

double Aws::Utils::Json::JsonView::AsDouble ( ) const

Returns the value of this node as a double precision floating-point.

◆ AsInt64()

int64_t Aws::Utils::Json::JsonView::AsInt64 ( ) const

Returns the value of this node as 64-bit integer.

◆ AsInteger()

int Aws::Utils::Json::JsonView::AsInteger ( ) const

Returns the value of this node as an int.

◆ AsObject()

JsonView Aws::Utils::Json::JsonView::AsObject ( ) const

Returns the value of this node as a JsonView object.

◆ AsString()

Aws::String Aws::Utils::Json::JsonView::AsString ( ) const

Returns the value of this node as a string. The behavior is undefined if the node is not of type string.

◆ GetAllObjects()

Aws::Map<Aws::String, JsonView> Aws::Utils::Json::JsonView::GetAllObjects ( ) const

Reads all json objects at the top level of this node (does not traverse the tree any further) along with their keys.

◆ GetArray()

Array<JsonView> Aws::Utils::Json::JsonView::GetArray ( const Aws::String key) const

Gets an array of JsonView objects from this node by its key.

◆ GetBool()

bool Aws::Utils::Json::JsonView::GetBool ( const Aws::String key) const

Gets a boolean value from this node by its key.

◆ GetDouble()

double Aws::Utils::Json::JsonView::GetDouble ( const Aws::String key) const

Gets a double precision floating-point value from this node by its key.

◆ GetInt64()

int64_t Aws::Utils::Json::JsonView::GetInt64 ( const Aws::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.

◆ GetInteger()

int Aws::Utils::Json::JsonView::GetInteger ( const Aws::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.

◆ GetObject()

JsonView Aws::Utils::Json::JsonView::GetObject ( const Aws::String key) const

Gets a JsonView object from this node by its key.

◆ GetString()

Aws::String Aws::Utils::Json::JsonView::GetString ( const Aws::String key) const

Gets a string from this node by its key.

◆ IsBool()

bool Aws::Utils::Json::JsonView::IsBool ( ) const

Tests whether the current value is a boolean.

◆ IsFloatingPointType()

bool Aws::Utils::Json::JsonView::IsFloatingPointType ( ) const

Tests whether the current value is a floating-point.

◆ IsIntegerType()

bool Aws::Utils::Json::JsonView::IsIntegerType ( ) const

Tests whether the current value is an int or int64_t. Returns false if the value is floating-point.

◆ IsListType()

bool Aws::Utils::Json::JsonView::IsListType ( ) const

Tests whether the current value is a JSON array.

◆ IsNull()

bool Aws::Utils::Json::JsonView::IsNull ( ) const

Tests whether the current value is NULL.

◆ IsObject()

bool Aws::Utils::Json::JsonView::IsObject ( ) const

Tests whether the current value is a JSON object.

◆ IsString()

bool Aws::Utils::Json::JsonView::IsString ( ) const

Tests whether the current value is a string.

◆ KeyExists()

bool Aws::Utils::Json::JsonView::KeyExists ( const Aws::String key) const

Tests whether a key exists at the current node level.

◆ Materialize()

JsonValue Aws::Utils::Json::JsonView::Materialize ( ) const

Creates a deep copy of the JSON value rooted in the current JSON view.

◆ operator=()

JsonView& Aws::Utils::Json::JsonView::operator= ( const JsonValue v)

◆ ValueExists()

bool Aws::Utils::Json::JsonView::ValueExists ( const Aws::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.

◆ WriteCompact()

Aws::String Aws::Utils::Json::JsonView::WriteCompact ( bool  treatAsObject = true) const

Writes the current JSON view without whitespace characters starting at the current level to a string.

Parameters
treatAsObjectif the current value is empty, writes out '{}' rather than an empty string.

◆ WriteReadable()

Aws::String Aws::Utils::Json::JsonView::WriteReadable ( bool  treatAsObject = true) const

Writes the current JSON view to a string in a human friendly format.

Parameters
treatAsObjectif the current value is empty, writes out '{}' rather than an empty string.

The documentation for this class was generated from the following file: