ArcGIS Procedural Runtime
3.2.10650
|
#include <ResolveMap.h>
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 &) | |
The prtx specialization of the prt::ResolveMap adds convenience functions to directly support STL strings and URIs.
|
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.
containerKey | A key representing a container resource. |
embeddedKey | A "relative" key uniquely identifying an embedded resource within the container. |
|
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.
resolveMap | The ResolveMap to be used when resolving the resulting key or a nullptr if none will be used. |
anchorKey | The key that is the anchor point for the relative key. |
relativeKey | The key of the asset referenced relatively from the base key asset. |
|
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'.
key | The key whose last '/' separated segment needs to be replaced. |
newSegment | The new segment. |
|
pure virtual |
returns empty URI if key could not be resolved
|
static |
Helper function to resolve a key with fall back to URI = key if key not found in ResolveMap.
resolveMap | The resolveMap to use. |
key | The key to resolve. If fallback to URI is used, key must be percent encoded. |
|
pure virtual |
Performs a reverse lookup and returns all keys which map to a given uri.
|
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.
project | The name of the current project ("projects" are "subfolders" in the resolve map starting with a '/'). |
query | The search query. See the CGA fileSearch() function for syntax documentation. |