AWS SDK for C++  1.7.227
AWS SDK for C++
Public Member Functions | Friends | List of all members
Aws::Utils::Json::JsonValue Class Reference

#include <JsonSerializer.h>

Public Member Functions

 JsonValue ()
 
 JsonValue (const Aws::String &value)
 
 JsonValue (Aws::IStream &istream)
 
 JsonValue (const JsonValue &value)
 
 JsonValue (JsonValue &&value)
 
 ~JsonValue ()
 
JsonValueoperator= (const JsonValue &other)
 
JsonValueoperator= (JsonValue &&other)
 
bool operator== (const JsonValue &other) const
 
bool operator!= (const JsonValue &other) const
 
JsonValueWithString (const Aws::String &key, const Aws::String &value)
 
JsonValueWithString (const char *key, const Aws::String &value)
 
JsonValueAsString (const Aws::String &value)
 
JsonValueWithBool (const Aws::String &key, bool value)
 
JsonValueWithBool (const char *key, bool value)
 
JsonValueAsBool (bool value)
 
JsonValueWithInteger (const Aws::String &key, int value)
 
JsonValueWithInteger (const char *key, int value)
 
JsonValueAsInteger (int value)
 
JsonValueWithInt64 (const Aws::String &key, long long value)
 
JsonValueWithInt64 (const char *key, long long value)
 
JsonValueAsInt64 (long long value)
 
JsonValueWithDouble (const Aws::String &key, double value)
 
JsonValueWithDouble (const char *key, double value)
 
JsonValueAsDouble (double value)
 
JsonValueWithArray (const Aws::String &key, const Array< Aws::String > &array)
 
JsonValueWithArray (const char *key, const Array< Aws::String > &array)
 
JsonValueWithArray (const Aws::String &key, const Array< JsonValue > &array)
 
JsonValueWithArray (const Aws::String &key, Array< JsonValue > &&array)
 
JsonValueAsArray (const Array< JsonValue > &array)
 
JsonValueAsArray (Array< JsonValue > &&array)
 
JsonValueWithObject (const Aws::String &key, const JsonValue &value)
 
JsonValueWithObject (const char *key, const JsonValue &value)
 
JsonValueWithObject (const Aws::String &key, JsonValue &&value)
 
JsonValueWithObject (const char *key, JsonValue &&value)
 
JsonValueAsObject (const JsonValue &value)
 
JsonValueAsObject (JsonValue &&value)
 
bool WasParseSuccessful () const
 
const Aws::StringGetErrorMessage () const
 
JsonView View () const
 

Friends

class JsonView
 

Detailed Description

JSON DOM manipulation class. To read or serialize use View function.

Definition at line 39 of file JsonSerializer.h.

Constructor & Destructor Documentation

◆ JsonValue() [1/5]

Aws::Utils::Json::JsonValue::JsonValue ( )

Constructs empty JSON DOM.

◆ JsonValue() [2/5]

Aws::Utils::Json::JsonValue::JsonValue ( const Aws::String value)

Constructs a JSON DOM by parsing the input string.

◆ JsonValue() [3/5]

Aws::Utils::Json::JsonValue::JsonValue ( Aws::IStream istream)

Constructs a JSON DOM by parsing the text in the input stream.

◆ JsonValue() [4/5]

Aws::Utils::Json::JsonValue::JsonValue ( const JsonValue value)

Performs a deep copy of the JSON DOM parameter. Prefer using a JsonView if copying is not needed.

◆ JsonValue() [5/5]

Aws::Utils::Json::JsonValue::JsonValue ( JsonValue &&  value)

Moves the ownership of the internal JSON DOM. No copying is performed.

◆ ~JsonValue()

Aws::Utils::Json::JsonValue::~JsonValue ( )

Member Function Documentation

◆ AsArray() [1/2]

JsonValue& Aws::Utils::Json::JsonValue::AsArray ( const Array< JsonValue > &  array)

Converts the current JSON node to an array whose values are deep-copied from the array parameter.

◆ AsArray() [2/2]

JsonValue& Aws::Utils::Json::JsonValue::AsArray ( Array< JsonValue > &&  array)

Converts the current JSON node to an array whose values are moved from the array parameter.

◆ AsBool()

JsonValue& Aws::Utils::Json::JsonValue::AsBool ( bool  value)

Converts the current JSON node to a bool.

◆ AsDouble()

JsonValue& Aws::Utils::Json::JsonValue::AsDouble ( double  value)

Converts the current JSON node to a double.

◆ AsInt64()

JsonValue& Aws::Utils::Json::JsonValue::AsInt64 ( long long  value)

Converts the current JSON node to a 64-bit integer.

◆ AsInteger()

JsonValue& Aws::Utils::Json::JsonValue::AsInteger ( int  value)

Converts the current JSON node to an integer.

◆ AsObject() [1/2]

JsonValue& Aws::Utils::Json::JsonValue::AsObject ( const JsonValue value)

Converts the current JSON node to a JSON object by deep-copying the parameter.

◆ AsObject() [2/2]

JsonValue& Aws::Utils::Json::JsonValue::AsObject ( JsonValue &&  value)

Converts the current JSON node to a JSON object by moving from the parameter.

◆ AsString()

JsonValue& Aws::Utils::Json::JsonValue::AsString ( const Aws::String value)

Converts the current JSON node to a string.

◆ GetErrorMessage()

const Aws::String& Aws::Utils::Json::JsonValue::GetErrorMessage ( ) const
inline

Returns the last error message from a failed parse attempt. Returns empty string if no error.

Definition at line 206 of file JsonSerializer.h.

◆ operator!=()

bool Aws::Utils::Json::JsonValue::operator!= ( const JsonValue other) const

◆ operator=() [1/2]

JsonValue& Aws::Utils::Json::JsonValue::operator= ( const JsonValue other)

Performs a deep copy of the JSON DOM parameter.

◆ operator=() [2/2]

JsonValue& Aws::Utils::Json::JsonValue::operator= ( JsonValue &&  other)

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.

Warning
This will result in invalidating any outstanding views of the current DOM. However, views to the moved-from DOM would still valid.

◆ operator==()

bool Aws::Utils::Json::JsonValue::operator== ( const JsonValue other) const

◆ View()

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

Creates a view from the current root JSON node.

◆ WasParseSuccessful()

bool Aws::Utils::Json::JsonValue::WasParseSuccessful ( ) const
inline

Returns true if the last parse request was successful. If this returns false, you can call GetErrorMessage() to find the cause.

Definition at line 198 of file JsonSerializer.h.

◆ WithArray() [1/4]

JsonValue& Aws::Utils::Json::JsonValue::WithArray ( const Aws::String key,
const Array< Aws::String > &  array 
)

Adds an array of strings to the top level of this node at key.

◆ WithArray() [2/4]

JsonValue& Aws::Utils::Json::JsonValue::WithArray ( const char *  key,
const Array< Aws::String > &  array 
)

◆ WithArray() [3/4]

JsonValue& Aws::Utils::Json::JsonValue::WithArray ( const Aws::String key,
const Array< JsonValue > &  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.

◆ WithArray() [4/4]

JsonValue& Aws::Utils::Json::JsonValue::WithArray ( const Aws::String key,
Array< JsonValue > &&  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.

◆ WithBool() [1/2]

JsonValue& Aws::Utils::Json::JsonValue::WithBool ( const Aws::String key,
bool  value 
)

Adds a bool value with key to the top level of this node.

◆ WithBool() [2/2]

JsonValue& Aws::Utils::Json::JsonValue::WithBool ( const char *  key,
bool  value 
)

◆ WithDouble() [1/2]

JsonValue& Aws::Utils::Json::JsonValue::WithDouble ( const Aws::String key,
double  value 
)

Adds a double value at key at the top level of this node.

◆ WithDouble() [2/2]

JsonValue& Aws::Utils::Json::JsonValue::WithDouble ( const char *  key,
double  value 
)

◆ WithInt64() [1/2]

JsonValue& Aws::Utils::Json::JsonValue::WithInt64 ( const Aws::String key,
long long  value 
)

Adds a 64-bit integer value at key to the top level of this node.

◆ WithInt64() [2/2]

JsonValue& Aws::Utils::Json::JsonValue::WithInt64 ( const char *  key,
long long  value 
)

◆ WithInteger() [1/2]

JsonValue& Aws::Utils::Json::JsonValue::WithInteger ( const Aws::String key,
int  value 
)

Adds an integer value at key at the top level of this node.

◆ WithInteger() [2/2]

JsonValue& Aws::Utils::Json::JsonValue::WithInteger ( const char *  key,
int  value 
)

◆ WithObject() [1/4]

JsonValue& Aws::Utils::Json::JsonValue::WithObject ( const Aws::String key,
const JsonValue value 
)

Adds a JSON object to the top level of this node at key. The object parameter is deep-copied.

◆ WithObject() [2/4]

JsonValue& Aws::Utils::Json::JsonValue::WithObject ( const char *  key,
const JsonValue value 
)

◆ WithObject() [3/4]

JsonValue& Aws::Utils::Json::JsonValue::WithObject ( const Aws::String key,
JsonValue &&  value 
)

Adds a JSON object to the top level of this node at key.

◆ WithObject() [4/4]

JsonValue& Aws::Utils::Json::JsonValue::WithObject ( const char *  key,
JsonValue &&  value 
)

◆ WithString() [1/2]

JsonValue& Aws::Utils::Json::JsonValue::WithString ( const Aws::String key,
const Aws::String value 
)

Adds a string to the top level of this node with key.

◆ WithString() [2/2]

JsonValue& Aws::Utils::Json::JsonValue::WithString ( const char *  key,
const Aws::String value 
)

Friends And Related Function Documentation

◆ JsonView

friend class JsonView
friend

Definition at line 222 of file JsonSerializer.h.


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