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

Public Types

using ImportPathStack = AZStd::vector< AZ::IO::FixedMaxPath >
 

Public Member Functions

JsonImportResolveroperator= (const JsonImportResolver &rhs)=delete
 
JsonImportResolveroperator= (JsonImportResolver &&rhs)=delete
 
 JsonImportResolver (const JsonImportResolver &rhs)=delete
 
 JsonImportResolver (JsonImportResolver &&rhs)=delete
 

Static Public Member Functions

static JsonSerializationResult::ResultCode ResolveImports (rapidjson::Value &jsonDoc, rapidjson::Document::AllocatorType &allocator, ImportPathStack &importPathStack, JsonImportSettings &settings, StackedString &element)
 
static JsonSerializationResult::ResultCode ResolveImportsInOrder (rapidjson::Value &target, rapidjson::Document::AllocatorType &allocator, const rapidjson::Value &source, ImportPathStack &importPathStack, JsonImportSettings &settings, StackedString &element)
 
static JsonSerializationResult::ResultCode StoreImports (const rapidjson::Value &jsonDoc, ImportPathStack &importPathStack, JsonImportSettings &settings, StackedString &element)
 
static JsonSerializationResult::ResultCode RestoreImports (rapidjson::Value &jsonDoc, rapidjson::Document::AllocatorType &allocator, JsonImportSettings &settings)
 

Member Function Documentation

◆ ResolveImportsInOrder()

static JsonSerializationResult::ResultCode AZ::JsonImportResolver::ResolveImportsInOrder ( rapidjson::Value &  target,
rapidjson::Document::AllocatorType &  allocator,
const rapidjson::Value &  source,
ImportPathStack importPathStack,
JsonImportSettings settings,
StackedString element 
)
static

Resolves the imports from the source JSON object in the field order. It does this by iterating over the fields of the source JSON object and copies them to the target object as it processes them. Any $import directives are merged to the target object at that point using the JSON Merge Patch algorithm. This allows fields before the $import directive to be overridden via the patching mechanism and fields that appear after the $import directive to override the imported JSON

◆ StoreImports()

static JsonSerializationResult::ResultCode AZ::JsonImportResolver::StoreImports ( const rapidjson::Value &  jsonDoc,
ImportPathStack importPathStack,
JsonImportSettings settings,
StackedString element 
)
static

Store imports only gathers the list of resolved $import paths without merging their contents into the json document


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