ArcGIS Procedural Runtime  3.2.10650
List of all members | Public Member Functions | Static Public Member Functions
prtx::ResolveMap Class Referenceabstract

#include <ResolveMap.h>

Inheritance diagram for prtx::ResolveMap:
[legend]

Public Member Functions

virtual prtx::URIPtr resolveKey (const std::wstring &key) const =0
 
virtual std::vector< std::wstring > resolveURI (const prtx::URIPtr &uri) const =0
 
virtual std::wstring searchKey (const std::wstring &project, const std::wstring &query) const =0
 
- Public Member Functions inherited from prt::ResolveMap
virtual const wchar_t * findCGBKey (Status *stat=nullptr) const =0
 
virtual const wchar_t ** findCGBKeys (const wchar_t **result, size_t *resultSize, Status *stat=nullptr) const =0
 
virtual wchar_t * searchKey (const wchar_t *project, const wchar_t *query, wchar_t *result, size_t *resultSize, Status *stat=nullptr) const =0
 
- Public Member Functions inherited from prt::Attributable
virtual bool getBool (const wchar_t *key, Status *stat=0) const =0
 
virtual const bool * getBoolArray (const wchar_t *key, size_t *count, Status *stat=0) const =0
 
virtual double getFloat (const wchar_t *key, Status *stat=0) const =0
 
virtual const double * getFloatArray (const wchar_t *key, size_t *count, Status *stat=0) const =0
 
virtual int32_t getInt (const wchar_t *key, Status *stat=0) const =0
 
virtual const int32_t * getIntArray (const wchar_t *key, size_t *count, Status *stat=0) const =0
 
virtual const wchar_t *const * getKeys (size_t *count, Status *stat=0) const =0
 
virtual const wchar_t * getString (const wchar_t *key, Status *stat=0) const =0
 
virtual const wchar_t *const * getStringArray (const wchar_t *key, size_t *count, Status *stat=0) const =0
 
virtual PrimitiveType getType (const wchar_t *key, Status *stat=0) const =0
 
virtual bool hasKey (const wchar_t *key, Status *stat=0) const =0
 
- Public Member Functions inherited from prt::Object
void destroy () const
 
virtual char * toXML (char *result, size_t *resultSize, Status *stat=0) const =0
 
char * toXMLDocument (char *result, size_t *resultSize, Status *stat=0) const
 

Static Public Member Functions

static std::wstring anchorEmbeddedKey (const std::wstring &containerKey, const std::wstring &embeddedKey)
 
static std::wstring anchorRelativeKey (const prt::ResolveMap *resolveMap, const std::wstring &anchorKey, const std::wstring &relativeKey)
 
static std::wstring replaceLastKeySegment (const std::wstring &key, const std::wstring &newSegment)
 
static prtx::URIPtr resolveKeyWithURIFallback (ResolveMap const *resolveMap, const std::wstring &key)
 

Additional Inherited Members

- Public Types inherited from prt::Attributable
enum  PrimitiveType {
  PT_UNDEFINED,
  PT_STRING,
  PT_FLOAT,
  PT_BOOL,
  PT_INT,
  PT_STRING_ARRAY,
  PT_FLOAT_ARRAY,
  PT_BOOL_ARRAY,
  PT_INT_ARRAY,
  PT_BLIND_DATA,
  PT_BLIND_DATA_ARRAY,
  PT_COUNT
}
 
- Protected Member Functions inherited from prt::Object
 Object (const Object &)
 

Detailed Description

The prtx specialization of the prt::ResolveMap adds convenience functions to directly support STL strings and URIs.

Member Function Documentation

◆ anchorEmbeddedKey()

static std::wstring prtx::ResolveMap::anchorEmbeddedKey ( const std::wstring &  containerKey,
const std::wstring &  embeddedKey 
)
static

Creates a resolve map key from a container asset key and an embedded resource key, typically a texture.

This is useful in e.g. custom decoders to lookup texture URIs in resolve maps that have been created recursively, e.g. for assets like GLB or USDZ that contain embedded textures.

PRT is using the same logic internally when creating the resolve maps.

Parameters
containerKeyA key representing a container resource.
embeddedKeyA "relative" key uniquely identifying an embedded resource within the container.
Returns
The combined key identifying the resource within the container.

◆ anchorRelativeKey()

static std::wstring prtx::ResolveMap::anchorRelativeKey ( const prt::ResolveMap resolveMap,
const std::wstring &  anchorKey,
const std::wstring &  relativeKey 
)
static

Resolvemap keys are often based on file paths, and often files are referenced relative to a "base file". This is a helper function to anchor such a relative path at a key and thereby create the absolute key corresponding to the relative path.

An example is the obj file 'assets/elements/window.obj' which contains a reference to the texture 'glass.jpg': the actual key for the texture must contain the base path of the referring file, i.e. 'assets/elements/glass.jpg'. In the more complex case that "../glass.jpg" is referenced the resulting absolute key is "/assets/glass.jpg".

In case the anchored key cannot be found in the resolveMap (or it is null) the anchor key is assumed to be a URI and the relativeKey is therefore percent encoded.

Note: This function converts all backslashes to forward slashes.

Parameters
resolveMapThe ResolveMap to be used when resolving the resulting key or a nullptr if none will be used.
anchorKeyThe key that is the anchor point for the relative key.
relativeKeyThe key of the asset referenced relatively from the base key asset.
Returns
key constructed relative to baseKey

◆ replaceLastKeySegment()

static std::wstring prtx::ResolveMap::replaceLastKeySegment ( const std::wstring &  key,
const std::wstring &  newSegment 
)
static

[DEPRECATED, use anchorRelativeKey()] Helper function to replace the last segment in a key. Keys are often separated by '/' characters, for instance 'assets/elements/window.obj', and relative keys need to be constructed, e.g. 'assets/elements/glass.jpg'.

Parameters
keyThe key whose last '/' separated segment needs to be replaced.
newSegmentThe new segment.
Returns
key with the last segment replaced.

◆ resolveKey()

virtual prtx::URIPtr prtx::ResolveMap::resolveKey ( const std::wstring &  key) const
pure virtual

returns empty URI if key could not be resolved

◆ resolveKeyWithURIFallback()

static prtx::URIPtr prtx::ResolveMap::resolveKeyWithURIFallback ( ResolveMap const *  resolveMap,
const std::wstring &  key 
)
static

Helper function to resolve a key with fall back to URI = key if key not found in ResolveMap.

Parameters
resolveMapThe resolveMap to use.
keyThe key to resolve. If fallback to URI is used, key must be percent encoded.
Returns
the resolved URI if key can be resolved or a URI with the key else.

◆ resolveURI()

virtual std::vector<std::wstring> prtx::ResolveMap::resolveURI ( const prtx::URIPtr uri) const
pure virtual

Performs a reverse lookup and returns all keys which map to a given uri.

◆ searchKey()

virtual std::wstring prtx::ResolveMap::searchKey ( const std::wstring &  project,
const std::wstring &  query 
) const
pure virtual

Searches the keys in the ResolveMap for the expression defined in query. Supported search queries include wildcards, regular expressions and file properties.

This implements the CGA fileSearch() function. This function is thread-safe.

Parameters
projectThe name of the current project ("projects" are "subfolders" in the resolve map starting with a '/').
queryThe search query. See the CGA fileSearch() function for syntax documentation.
Returns
result.

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