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

#include <DomPatch.h>

Public Types

using StrategyFunctor = AZStd::function< void(PatchApplicationState &)>
 
using OperationsContainer = AZStd::deque< PatchOperation >
 

Public Member Functions

 Patch (const Patch &)=default
 
 Patch (Patch &&)=default
 
 Patch (AZStd::initializer_list< PatchOperation > init)
 
template<class InputIterator >
 Patch (InputIterator first, InputIterator last)
 
Patchoperator= (const Patch &)=default
 
Patchoperator= (Patch &&)=default
 
bool operator== (const Patch &rhs) const
 
bool operator!= (const Patch &rhs) const
 
const OperationsContainerGetOperations () const
 
void PushBack (PatchOperation op)
 
void PushFront (PatchOperation op)
 
void Pop ()
 
void Clear ()
 
const PatchOperationAt (size_t index) const
 
size_t Size () const
 
PatchOperationoperator[] (size_t index)
 
const PatchOperationoperator[] (size_t index) const
 
OperationsContainer::iterator begin ()
 
OperationsContainer::iterator end ()
 
OperationsContainer::const_iterator begin () const
 
OperationsContainer::const_iterator end () const
 
OperationsContainer::const_iterator cbegin () const
 
OperationsContainer::const_iterator cend () const
 
size_t size () const
 
AZ::Outcome< Value, AZStd::stringApply (Value rootElement, StrategyFunctor strategy=PatchApplicationStrategy::HaltOnFailure) const
 
PatchOutcome ApplyInPlace (Value &rootElement, StrategyFunctor strategy=PatchApplicationStrategy::HaltOnFailure) const
 
AZ::Outcome< Value, AZStd::stringApplyAndDenormalize (Value rootElement, StrategyFunctor strategy=PatchApplicationStrategy::HaltOnFailure)
 
PatchOutcome ApplyInPlaceAndDenormalize (Value &rootElement, StrategyFunctor strategy=PatchApplicationStrategy::HaltOnFailure)
 
Value GetDomRepresentation () const
 
bool ContainsNormalizedEntries () const
 

Static Public Member Functions

static AZ::Outcome< Patch, AZStd::stringCreateFromDomRepresentation (Value domValue)
 

Detailed Description

A set of operations that can be applied to a Value to produce a new Value.

See also
PatchOperation

Member Function Documentation

◆ Apply()

AZ::Outcome< Value, AZStd::string > AZ::Dom::Patch::Apply ( Value  rootElement,
StrategyFunctor  strategy = PatchApplicationStrategy::HaltOnFailure 
) const

Applies this patch to the given DOM element.

Parameters
rootElementThe DOM element to patch.
strategyA callback to be run after every patch application, see PatchApplicationState.
Returns
an outcome with either the patched element or an error string

◆ ApplyAndDenormalize()

AZ::Outcome< Value, AZStd::string > AZ::Dom::Patch::ApplyAndDenormalize ( Value  rootElement,
StrategyFunctor  strategy = PatchApplicationStrategy::HaltOnFailure 
)

Applies this patch to the given DOM element. After applying the patch, any "EndOfArray" patch entries are denormalized into their resolved paths. This operation mutates the underyling patch operations; make a copy if you wish to keep the original patch.

Parameters
rootElementThe DOM element to patch.
strategyA callback to be run after every patch application, see PatchApplicationState.
Returns
an outcome with either the patched element or an error string

◆ ApplyInPlace()

PatchOutcome AZ::Dom::Patch::ApplyInPlace ( Value rootElement,
StrategyFunctor  strategy = PatchApplicationStrategy::HaltOnFailure 
) const

Applies this patch to the given DOM element in place, changing it to the new value.

Parameters
rootElementThe DOM element to patch.
strategyA callback to be run after every patch application, see PatchApplicationState.
Returns
an outcome with either the patched element or an error string

◆ ApplyInPlaceAndDenormalize()

PatchOutcome AZ::Dom::Patch::ApplyInPlaceAndDenormalize ( Value rootElement,
StrategyFunctor  strategy = PatchApplicationStrategy::HaltOnFailure 
)

Applies this patch to the given DOM element in place, changing it to the new value. After applying the patch, any "EndOfArray" patch entries are denormalized into their resolved paths. This operation mutates the underyling patch operations; make a copy if you wish to keep the original patch.

Parameters
rootElementThe DOM element to patch.
strategyA callback to be run after every patch application, see PatchApplicationState.
Returns
an outcome with either the patched element or an error string

◆ ContainsNormalizedEntries()

bool AZ::Dom::Patch::ContainsNormalizedEntries ( ) const

Returns true if any of this patch's operations contain an "EndOfArray" entry inside their paths, meaning the path requires a lookup inside a target DOM.


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