HDK
|
#include <defaultResolver.h>
Static Public Member Functions | |
static AR_API void | SetDefaultSearchPath (const std::vector< std::string > &searchPath) |
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):
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 64 of file defaultResolver.h.
AR_API ArDefaultResolver::ArDefaultResolver | ( | ) |
|
virtual |
|
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. This must be called before the first call to ArGetResolver. The specified paths will be searched in addition to, and before paths specified via the environment variable PXR_AR_DEFAULT_SEARCH_PATH