HDK
|
#include <defaultResolver.h>
Public Member Functions | |
AR_API | ArDefaultResolver ()=default |
virtual AR_API | ~ArDefaultResolver ()=default |
![]() | |
virtual AR_API | ~ArResolver () |
ArResolver (const ArResolver &)=delete | |
ArResolver & | operator= (const ArResolver &)=delete |
AR_API std::string | CreateIdentifier (const std::string &assetPath, const ArResolvedPath &anchorAssetPath=ArResolvedPath()) const |
AR_API std::string | CreateIdentifierForNewAsset (const std::string &assetPath, const ArResolvedPath &anchorAssetPath=ArResolvedPath()) const |
AR_API ArResolvedPath | Resolve (const std::string &assetPath) const |
AR_API ArResolvedPath | ResolveForNewAsset (const std::string &assetPath) const |
AR_API void | BindContext (const ArResolverContext &context, VtValue *bindingData) |
AR_API void | UnbindContext (const ArResolverContext &context, VtValue *bindingData) |
AR_API ArResolverContext | CreateDefaultContext () const |
AR_API ArResolverContext | CreateDefaultContextForAsset (const std::string &assetPath) const |
AR_API ArResolverContext | CreateContextFromString (const std::string &contextStr) const |
AR_API ArResolverContext | CreateContextFromString (const std::string &uriScheme, const std::string &contextStr) const |
AR_API ArResolverContext | CreateContextFromStrings (const std::vector< std::pair< std::string, std::string >> &contextStrs) const |
AR_API void | RefreshContext (const ArResolverContext &context) |
AR_API ArResolverContext | GetCurrentContext () const |
AR_API bool | IsContextDependentPath (const std::string &assetPath) const |
AR_API void | BeginCacheScope (VtValue *cacheScopeData) |
AR_API void | EndCacheScope (VtValue *cacheScopeData) |
AR_API bool | IsRepositoryPath (const std::string &path) const |
AR_API std::string | GetExtension (const std::string &assetPath) const |
AR_API ArAssetInfo | GetAssetInfo (const std::string &assetPath, const ArResolvedPath &resolvedPath) const |
AR_API ArTimestamp | GetModificationTimestamp (const std::string &assetPath, const ArResolvedPath &resolvedPath) const |
AR_API std::shared_ptr< ArAsset > | OpenAsset (const ArResolvedPath &resolvedPath) const |
AR_API std::shared_ptr < ArWritableAsset > | OpenAssetForWrite (const ArResolvedPath &resolvedPath, WriteMode writeMode) const |
AR_API bool | CanWriteAssetToPath (const ArResolvedPath &resolvedPath, std::string *whyNot=nullptr) const |
Static Public Member Functions | |
static AR_API void | SetDefaultSearchPath (const std::vector< std::string > &searchPath) |
Protected Member Functions | |
AR_API std::string | _CreateIdentifier (const std::string &assetPath, const ArResolvedPath &anchorAssetPath) const override |
AR_API std::string | _CreateIdentifierForNewAsset (const std::string &assetPath, const ArResolvedPath &anchorAssetPath) const override |
AR_API ArResolvedPath | _Resolve (const std::string &assetPath) const override |
AR_API ArResolvedPath | _ResolveForNewAsset (const std::string &assetPath) const override |
AR_API ArResolverContext | _CreateDefaultContext () const override |
AR_API ArResolverContext | _CreateDefaultContextForAsset (const std::string &assetPath) const override |
AR_API ArResolverContext | _CreateContextFromString (const std::string &contextStr) const override |
AR_API bool | _IsContextDependentPath (const std::string &assetPath) const override |
AR_API ArTimestamp | _GetModificationTimestamp (const std::string &path, const ArResolvedPath &resolvedPath) const override |
AR_API std::shared_ptr< ArAsset > | _OpenAsset (const ArResolvedPath &resolvedPath) const override |
AR_API std::shared_ptr < ArWritableAsset > | _OpenAssetForWrite (const ArResolvedPath &resolvedPath, WriteMode writeMode) const override |
![]() | |
AR_API | ArResolver () |
virtual AR_API bool | _IsRepositoryPath (const std::string &path) const |
virtual AR_API void | _BindContext (const ArResolverContext &context, VtValue *bindingData) |
virtual AR_API void | _UnbindContext (const ArResolverContext &context, VtValue *bindingData) |
virtual AR_API void | _RefreshContext (const ArResolverContext &context) |
virtual AR_API ArResolverContext | _GetCurrentContext () const |
virtual AR_API std::string | _GetExtension (const std::string &assetPath) const |
virtual AR_API ArAssetInfo | _GetAssetInfo (const std::string &assetPath, const ArResolvedPath &resolvedPath) const |
virtual AR_API bool | _CanWriteAssetToPath (const ArResolvedPath &resolvedPath, std::string *whyNot) const |
virtual AR_API void | _BeginCacheScope (VtValue *cacheScopeData) |
virtual AR_API void | _EndCacheScope (VtValue *cacheScopeData) |
template<class ContextObj > | |
const ContextObj * | _GetCurrentContextObject () const |
abs path to model * | ArResolvedPath ("/abs/path/to/shot.usd"))* |
Default asset resolution implementation used when no plugin implementation is provided.
In order to resolve assets specified by relative paths, this resolver implements a simple "search path" scheme. The resolver will anchor the relative path to a series of directories and return the first absolute path where the asset exists.
The first directory will always be the current working directory. The resolver will then examine the directories specified via the following mechanisms (in order):
The environment variable PXR_AR_DEFAULT_SEARCH_PATH may be used to specify an inital search path value. This is expected to be a list of directories delimited by the platform's standard path separator. A search path specified in this manner is overwritten by any call to ArDefaultResolver::SetDefaultSearchPath.
ArDefaultResolver supports creating an ArDefaultResolverContext via ArResolver::CreateContextFromString by passing a list of directories delimited by the platform's standard path separator.
Definition at line 50 of file defaultResolver.h.
|
default |
|
virtualdefault |
|
overrideprotectedvirtual |
Creates an ArDefaultResolverContext from contextStr
. This string is expected to be a list of directories delimited by the platform's standard path separator.
Reimplemented from ArResolver.
|
overrideprotectedvirtual |
Return a default ArResolverContext that may be bound to this resolver to resolve assets when no other context is explicitly specified.
When CreateDefaultContext is called on the configured asset resolver, Ar will call this method on the primary resolver and all URI/IRI resolvers and merge the results into a single ArResolverContext that will be returned to the consumer.
This function should not automatically bind this context, but should create one that may be used later.
The default implementation returns a default-constructed ArResolverContext.
Example uses:
Reimplemented from ArResolver.
|
overrideprotectedvirtual |
Creates a context that adds the directory containing assetPath
as a first directory to be searched, when the resulting context is bound (
If assetPath
is empty, returns an empty context; otherwise, if assetPath
is not an absolute filesystem path, it will first be anchored to the process's current working directory.
Reimplemented from ArResolver.
|
overrideprotected |
|
overrideprotectedvirtual |
Return an identifier for a new asset at the given assetPath
.
This is similar to _CreateIdentifier but is used to create identifiers for assets that may not exist yet and are being created.
Example uses:
Implements ArResolver.
|
overrideprotectedvirtual |
Return an ArTimestamp representing the last time the asset at assetPath
was modified. resolvedPath
is the resolved path computed for the given assetPath
. If a timestamp cannot be retrieved, return an invalid ArTimestamp.
The default implementation returns an invalid ArTimestamp.
Example uses:
Reimplemented from ArResolver.
|
overrideprotectedvirtual |
Return true if the result of resolving the given assetPath
may differ depending on the asset resolver context that is bound when Resolve is called, false otherwise.
The default implementation returns false.
Example uses:
Reimplemented from ArResolver.
|
overrideprotectedvirtual |
Return an ArAsset object for the asset located at resolvedPath
. Return an invalid std::shared_ptr if object could not be created (for example, if the asset at the given path could not be opened).
Note that clients may still be using the data associated with this object even after the last shared_ptr has been destroyed. For example, a client may have created a memory mapping using the FILE* presented in the ArAsset object; this would preclude truncating or overwriting any of the contents of that file.
Implements ArResolver.
|
overrideprotectedvirtual |
Creates an ArFilesystemWriteableAsset for the asset at the given resolvedPath
.
Implements ArResolver.
|
overrideprotectedvirtual |
Return the resolved path for the given assetPath
or an empty ArResolvedPath if no asset exists at that path.
Implements ArResolver.
|
overrideprotectedvirtual |
Return the resolved path for the given assetPath
that may be used to create a new asset or an empty ArResolvedPath if such a path cannot be computed.
Implements ArResolver.
|
static |
Set the default search path that will be used during asset resolution. Calling this function will trigger a ResolverChanged notification to be sent if the search path differs from the currently set default value.
The inital search path may be specified using via the environment variable PXR_AR_DEFAULT_SEARCH_PATH. Calling this function will override any path specified in this manner.
This function is not thread-safe and should not be called concurrently with any other ArResolver operations