Open 3D Engine AzCore API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::Dom::Json::RapidJsonValueWriter Class Referencefinal

Visitor that feeds into a rapidjson::Value. More...

#include <JsonSerializationUtils.h>

Inherits AZ::Dom::Visitor.

Public Member Functions

 RapidJsonValueWriter (rapidjson::Value &outputValue, rapidjson::Value::AllocatorType &allocator)
 
VisitorFlags GetVisitorFlags () const override
 
Result Null () override
 Operates on an empty null value.
 
Result Bool (bool value) override
 Operates on a bool value.
 
Result Int64 (AZ::s64 value) override
 Operates on a signed, 64 bit integer value.
 
Result Uint64 (AZ::u64 value) override
 Operates on an unsigned, 64 bit integer value.
 
Result Double (double value) override
 Operates on a double precision, 64 bit floating point value.
 
Result String (AZStd::string_view value, Lifetime lifetime) override
 
Result StartObject () override
 
Result EndObject (AZ::u64 attributeCount) override
 
Result Key (AZ::Name key) override
 
Result RawKey (AZStd::string_view key, Lifetime lifetime) override
 
Result StartArray () override
 
Result EndArray (AZ::u64 elementCount) override
 
- Public Member Functions inherited from AZ::Dom::Visitor
virtual VisitorFlags GetVisitorFlags () const
 
bool SupportsRawValues () const
 
bool SupportsRawKeys () const
 
bool SupportsObjects () const
 
bool SupportsArrays () const
 
bool SupportsNodes () const
 
bool SupportsOpaqueValues () const
 
virtual Result Null ()
 Operates on an empty null value.
 
virtual Result Bool (bool value)
 Operates on a bool value.
 
virtual Result Int64 (AZ::s64 value)
 Operates on a signed, 64 bit integer value.
 
virtual Result Uint64 (AZ::u64 value)
 Operates on an unsigned, 64 bit integer value.
 
virtual Result Double (double value)
 Operates on a double precision, 64 bit floating point value.
 
virtual Result String (AZStd::string_view value, Lifetime lifetime)
 
virtual Result RefCountedString (AZStd::shared_ptr< const AZStd::vector< char > > value, Lifetime lifetime)
 
virtual Result OpaqueValue (OpaqueType &value)
 
virtual Result RawValue (AZStd::string_view value, Lifetime lifetime)
 
virtual Result StartObject ()
 
virtual Result EndObject (AZ::u64 attributeCount)
 
virtual Result Key (AZ::Name key)
 
virtual Result RawKey (AZStd::string_view key, Lifetime lifetime)
 
virtual Result StartArray ()
 
virtual Result EndArray (AZ::u64 elementCount)
 
virtual Result StartNode (AZ::Name name)
 
virtual Result RawStartNode (AZStd::string_view name, Lifetime lifetime)
 
virtual Result EndNode (AZ::u64 attributeCount, AZ::u64 elementCount)
 

Additional Inherited Members

- Public Types inherited from AZ::Dom::Visitor
using Result = AZ::Outcome< void, VisitorError >
 
- Static Protected Member Functions inherited from AZ::Dom::Visitor
static Result VisitorFailure (VisitorErrorCode code)
 Helper method, constructs a failure Result with the specified code.
 
static Result VisitorFailure (VisitorErrorCode code, AZStd::string additionalInfo)
 Helper method, constructs a failure Result with the specified code and supplemental info.
 
static Result VisitorFailure (VisitorError error)
 Helper method, constructs a failure Result with the specified error.
 
static Result VisitorSuccess ()
 Helper method, constructs a success Result.
 

Detailed Description

Visitor that feeds into a rapidjson::Value.

Member Function Documentation

◆ Bool()

Result AZ::Dom::Json::RapidJsonValueWriter::Bool ( bool  value)
overridevirtual

Operates on a bool value.

Reimplemented from AZ::Dom::Visitor.

◆ Double()

Result AZ::Dom::Json::RapidJsonValueWriter::Double ( double  value)
overridevirtual

Operates on a double precision, 64 bit floating point value.

Reimplemented from AZ::Dom::Visitor.

◆ EndArray()

Result AZ::Dom::Json::RapidJsonValueWriter::EndArray ( AZ::u64  elementCount)
overridevirtual

Finishes operating on an Array. Callers must provide the number of elements that were provided to the array, i.e. the number of value calls made within the direct context of this array (but not any nested arrays / nodes).

Reimplemented from AZ::Dom::Visitor.

◆ EndObject()

Result AZ::Dom::Json::RapidJsonValueWriter::EndObject ( AZ::u64  attributeCount)
overridevirtual

Finishes operating on an Object. Callers must provide the number of attributes that were provided to the object, i.e. the number of key and value calls made within the direct context of this object (but not any nested objects / nodes).

Reimplemented from AZ::Dom::Visitor.

◆ GetVisitorFlags()

VisitorFlags AZ::Dom::Json::RapidJsonValueWriter::GetVisitorFlags ( ) const
overridevirtual

Returns a set of flags representing the operations this Visitor supports. The base implementation supports raw keys (

See also
VisitorFlags::SupportsRawKeys) and arrays (
VisitorFlags::SupportsArrays), objects (
VisitorFlags::SupportsObjects), and nodes (
VisitorFlags::SupportsNodes). Raw (
VisitorFlags::SupportsRawValues) and opaque values (
VisitorFlags::SupportsOpaqueValues) are disallowed by default, as their handling is intended to be implementation-specific.

Reimplemented from AZ::Dom::Visitor.

◆ Int64()

Result AZ::Dom::Json::RapidJsonValueWriter::Int64 ( AZ::s64  value)
overridevirtual

Operates on a signed, 64 bit integer value.

Reimplemented from AZ::Dom::Visitor.

◆ Key()

Result AZ::Dom::Json::RapidJsonValueWriter::Key ( AZ::Name  key)
overridevirtual

Specifies a key for a key/value pair. Key must be called subsequent to a call to StartObject or StartNode and immediately followed by calls representing the key's associated value.

Reimplemented from AZ::Dom::Visitor.

◆ Null()

Result AZ::Dom::Json::RapidJsonValueWriter::Null ( )
overridevirtual

Operates on an empty null value.

Reimplemented from AZ::Dom::Visitor.

◆ RawKey()

Result AZ::Dom::Json::RapidJsonValueWriter::RawKey ( AZStd::string_view  key,
Lifetime  lifetime 
)
overridevirtual

Specifies a key for a key/value pair using a raw string instead of AZ::Name.

See also
Key

Reimplemented from AZ::Dom::Visitor.

◆ StartArray()

Result AZ::Dom::Json::RapidJsonValueWriter::StartArray ( )
overridevirtual

Operates on an Array. Callers may make any number of subsequent value calls to represent the elements of the array, and then must call EndArray.

Reimplemented from AZ::Dom::Visitor.

◆ StartObject()

Result AZ::Dom::Json::RapidJsonValueWriter::StartObject ( )
overridevirtual

Operates on an Object. Callers may make any number of Key calls, followed by calls representing a value (including a nested StartObject call) and then must call EndObject.

Reimplemented from AZ::Dom::Visitor.

◆ String()

Result AZ::Dom::Json::RapidJsonValueWriter::String ( AZStd::string_view  value,
Lifetime  lifetime 
)
overridevirtual

Operates on a string value. As strings are a reference type, storage semantics are provided to indicate where the value may be stored persistently or requires a copy.

Parameters
lifetimeSpecifies the lifetime of this string - if the string has a temporary lifetime, it cannot safely be stored as a reference.

Reimplemented from AZ::Dom::Visitor.

◆ Uint64()

Result AZ::Dom::Json::RapidJsonValueWriter::Uint64 ( AZ::u64  value)
overridevirtual

Operates on an unsigned, 64 bit integer value.

Reimplemented from AZ::Dom::Visitor.


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