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::Backend Class Referenceabstract

Backends are registered centrally and used to transition DOM formats to and from a textual format. More...

#include <DomBackend.h>

Inherited by AZ::Dom::JsonBackend< ParseFlags, WriteFormat >.

Public Types

using WriteCallback = AZStd::function< Visitor::Result(Visitor &)>
 

Public Member Functions

virtual Visitor::Result ReadFromBuffer (const char *buffer, size_t size, AZ::Dom::Lifetime lifetime, Visitor &visitor)=0
 Attempt to read this format from the given buffer into the target Visitor.
 
virtual Visitor::Result ReadFromBufferInPlace (char *buffer, AZStd::optional< size_t > size, Visitor &visitor)
 
virtual Visitor::Result WriteToBuffer (AZStd::string &buffer, WriteCallback callback)=0
 Attempt to write a value to the specified string using a write callback.
 

Detailed Description

Backends are registered centrally and used to transition DOM formats to and from a textual format.

Member Typedef Documentation

◆ WriteCallback

A callback that accepts a Visitor, making DOM calls to inform the serializer, and returns an aggregate error code to indicate whether or not the operation succeeded.

Member Function Documentation

◆ ReadFromBuffer()

virtual Visitor::Result AZ::Dom::Backend::ReadFromBuffer ( const char *  buffer,
size_t  size,
AZ::Dom::Lifetime  lifetime,
Visitor visitor 
)
pure virtual

Attempt to read this format from the given buffer into the target Visitor.

Implemented in AZ::Dom::JsonBackend< ParseFlags, WriteFormat >.

◆ ReadFromBufferInPlace()

virtual Visitor::Result AZ::Dom::Backend::ReadFromBufferInPlace ( char *  buffer,
AZStd::optional< size_t >  size,
Visitor visitor 
)
virtual

Attempt to read this format from a mutable string into the target Visitor. This enables some backends to parse without making additional string allocations. This string must be null terminated. This string may be modified and read in place without being copied, so when calling this please ensure that:

  • The string won't be deallocated until the visitor no longer needs the values and
  • The string is safe to modify in place. The base implementation simply calls ReadFromBuffer.

Reimplemented in AZ::Dom::JsonBackend< ParseFlags, WriteFormat >.

◆ WriteToBuffer()

virtual Visitor::Result AZ::Dom::Backend::WriteToBuffer ( AZStd::string buffer,
WriteCallback  callback 
)
pure virtual

Attempt to write a value to the specified string using a write callback.

Implemented in AZ::Dom::JsonBackend< ParseFlags, WriteFormat >.


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