#include <DomVisitor.h>
Inherited by AZ::Dom::Json::RapidJsonValueWriter, and AZ::Dom::ValueWriter.
Public Types | |
using | Result = AZ::Outcome< void, VisitorError > |
Public Member Functions | |
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) |
Static Protected Member Functions | |
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. | |
An interface for performing operations on elements of a generic DOM (Document Object Model). A Document Object Model is defined here as a tree structure comprised of one of the following values:
OpaqueValue: An arbitrary value stored in an AZStd::any. This is a non-serializable representation of an entry useful for in-memory options. This is intended to be used as an intermediate value over the course of DOM transformation and as a proxy to pass through types of which the DOM has no knowledge to other systems.
Opaque values are rejected by the default VisitorInterface implementation.
Care should be ensured that DOMs representing opaque types are only visited by consumers that understand them.
using AZ::Dom::Visitor::Result = AZ::Outcome<void, VisitorError> |
The result of a Visitor operation. A failure indicates a non-recoverable issue and signals that no further visit calls may be made in the current state.
|
virtual |
Operates on a bool value.
Reimplemented in AZ::Dom::Json::RapidJsonValueWriter, and AZ::Dom::ValueWriter.
|
virtual |
Operates on a double precision, 64 bit floating point value.
Reimplemented in AZ::Dom::Json::RapidJsonValueWriter, and AZ::Dom::ValueWriter.
|
virtual |
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 in AZ::Dom::Json::RapidJsonValueWriter, and AZ::Dom::ValueWriter.
|
virtual |
Finishes operating on a Node. Callers must provide both the number of attributes the were provided and the number of elements that were provided to the node, attributes being values prefaced by a call to Key.
Reimplemented in AZ::Dom::ValueWriter.
|
virtual |
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 in AZ::Dom::Json::RapidJsonValueWriter, and AZ::Dom::ValueWriter.
|
virtual |
Returns a set of flags representing the operations this Visitor supports. The base implementation supports raw keys (
Reimplemented in AZ::Dom::Json::RapidJsonValueWriter, and AZ::Dom::ValueWriter.
|
virtual |
Operates on a signed, 64 bit integer value.
Reimplemented in AZ::Dom::Json::RapidJsonValueWriter, and AZ::Dom::ValueWriter.
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 in AZ::Dom::Json::RapidJsonValueWriter, and AZ::Dom::ValueWriter.
|
virtual |
Operates on an empty null value.
Reimplemented in AZ::Dom::Json::RapidJsonValueWriter, and AZ::Dom::ValueWriter.
|
virtual |
Operates on an opaque value. As opaque values are a reference type, storage semantics are provided to indicate where the value may be stored persistently or requires a copy. The base implementation of OpaqueValue rejects the operation, as opaque values are meant for special cases with specific implementations, not generic usage.
Reimplemented in AZ::Dom::ValueWriter.
|
virtual |
Specifies a key for a key/value pair using a raw string instead of AZ::Name.
Reimplemented in AZ::Dom::Json::RapidJsonValueWriter, and AZ::Dom::ValueWriter.
|
virtual |
Operates on a Node using a raw string instead of AZ::Name.
Reimplemented in AZ::Dom::ValueWriter.
|
virtual |
Operates on a raw value encoded as a UTF-8 string that hasn't had its type deduced. Visitors that support raw values (
|
virtual |
Operates on a ref-counted string value. S
lifetime | Specifies the lifetime of this string. If the string has a temporary lifetime, it may not be safely stored as a reference, but may still be safely stored as a ref-counted shared_ptr. |
Reimplemented in AZ::Dom::ValueWriter.
|
virtual |
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 in AZ::Dom::Json::RapidJsonValueWriter, and AZ::Dom::ValueWriter.
Operates on a Node. Callers may make any number of Key calls followed by value calls or value calls not prefixed with a Key call, and then must call EndNode. See StartObject and StartArray as Node types combine the functionality of both structures into a named Node structure.
Reimplemented in AZ::Dom::ValueWriter.
|
virtual |
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 in AZ::Dom::Json::RapidJsonValueWriter, and AZ::Dom::ValueWriter.
|
virtual |
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.
lifetime | Specifies the lifetime of this string - if the string has a temporary lifetime, it cannot safely be stored as a reference. |
Reimplemented in AZ::Dom::Json::RapidJsonValueWriter, and AZ::Dom::ValueWriter.
bool AZ::Dom::Visitor::SupportsArrays | ( | ) | const |
bool AZ::Dom::Visitor::SupportsNodes | ( | ) | const |
bool AZ::Dom::Visitor::SupportsObjects | ( | ) | const |
bool AZ::Dom::Visitor::SupportsOpaqueValues | ( | ) | const |
bool AZ::Dom::Visitor::SupportsRawKeys | ( | ) | const |
bool AZ::Dom::Visitor::SupportsRawValues | ( | ) | const |
|
virtual |
Operates on an unsigned, 64 bit integer value.
Reimplemented in AZ::Dom::Json::RapidJsonValueWriter, and AZ::Dom::ValueWriter.