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::Path Class Referencefinal

Represents a path, represented as a series of PathEntry values, to a position in a Value. More...

#include <DomPath.h>

Public Types

using ContainerType = AZStd::vector< PathEntry >
 

Public Member Functions

 Path (const Path &)=default
 
 Path (Path &&)=default
 
 Path (AZStd::initializer_list< PathEntry > init)
 
 Path (AZStd::string_view pathString)
 
template<class InputIterator >
 Path (InputIterator first, InputIterator last)
 
Pathoperator= (const Path &)=default
 
Pathoperator= (Path &&)=default
 
Path operator/ (const PathEntry &) const
 
Path operator/ (size_t) const
 
Path operator/ (AZ::Name) const
 
Path operator/ (AZStd::string_view) const
 
Path operator/ (const Path &) const
 
Pathoperator/= (const PathEntry &)
 
Pathoperator/= (size_t)
 
Pathoperator/= (AZ::Name)
 
Pathoperator/= (AZStd::string_view)
 
Pathoperator/= (const Path &)
 
bool operator== (const Path &) const
 
bool operator!= (const Path &rhs) const
 
const ContainerTypeGetEntries () const
 
void Push (PathEntry entry)
 
void Push (size_t entry)
 
void Push (AZ::Name entry)
 
void Push (AZStd::string_view key)
 
void Pop ()
 
void Clear ()
 
PathEntry At (size_t index) const
 
PathEntry Back () const
 
size_t Size () const
 
bool IsEmpty () const
 
PathEntryoperator[] (size_t index)
 
const PathEntryoperator[] (size_t index) const
 
ContainerType::iterator begin ()
 
ContainerType::iterator end ()
 
ContainerType::const_iterator begin () const
 
ContainerType::const_iterator end () const
 
ContainerType::const_iterator cbegin () const
 
ContainerType::const_iterator cend () const
 
size_t size () const
 
size_t GetStringLength () const
 
size_t FormatString (char *stringBuffer, size_t bufferSize) const
 
AZStd::string ToString () const
 Returns a JSON-pointer style path string for this path.
 
void AppendToString (AZStd::string &output) const
 
template<class T >
void AppendToString (T &output) const
 
void FromString (AZStd::string_view pathString)
 
bool ContainsNormalizedEntries () const
 Returns true if this path contains any "EndOfArray" entries that require a target DOM to look up.
 

Static Public Attributes

static constexpr char PathSeparator = '/'
 
static constexpr char EscapeCharacter = '~'
 
static constexpr char TildeSequence = '0'
 
static constexpr char ForwardSlashSequence = '1'
 
static constexpr char EndOfArrayCharacter = '-'
 

Detailed Description

Represents a path, represented as a series of PathEntry values, to a position in a Value.

Constructor & Destructor Documentation

◆ Path()

AZ::Dom::Path::Path ( AZStd::string_view  pathString)
explicit

Creates a Path from a path string, a path string is formatted per the JSON pointer specification and looks like "/path/to/value/0"

Member Function Documentation

◆ FormatString()

size_t AZ::Dom::Path::FormatString ( char *  stringBuffer,
size_t  bufferSize 
) const

Formats a JSON-pointer style path string into the target buffer. This operation will fail if bufferSize < GetStringLength() + 1

Returns
The number of bytes written, excepting the null terminator.

◆ FromString()

void AZ::Dom::Path::FromString ( AZStd::string_view  pathString)

Reads a JSON-pointer style path from pathString and replaces this path's contents. Paths are accepted in the following forms: "/path/to/foo/0" "path/to/foo/0"

◆ GetStringLength()

size_t AZ::Dom::Path::GetStringLength ( ) const

Gets the length this path would require, if string-formatted. The length includes the contents of the string but not a null terminator.


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