24 #ifndef INCLUDE_AR_RESOLVER
25 #error This file should not be included directly. Include resolver.h instead.
28 #ifndef PXR_USD_AR_RESOLVER_V1_H
29 #define PXR_USD_AR_RESOLVER_V1_H
34 #include "pxr/usd/ar/api.h"
39 PXR_NAMESPACE_OPEN_SCOPE
91 const std::string& anchorPath,
92 const std::string& path) = 0;
108 virtual std::string
GetExtension(
const std::string& path) = 0;
126 virtual std::string
Resolve(
const std::string& path) = 0;
175 const std::string& filePath) = 0;
208 const std::string& path,
216 const std::string& identifier,
217 const std::string& filePath,
218 const std::string& fileVersion,
234 const std::string& path,
235 const std::string& resolvedPath) = 0;
253 const std::string& path,
254 const std::string& resolvedPath) = 0;
268 virtual std::shared_ptr<ArAsset>
OpenAsset(
269 const std::string& resolvedPath) = 0;
286 const std::string& path) = 0;
299 const std::string& path,
300 std::string* whyNot) = 0;
309 const std::string& identifier,
310 std::string* whyNot) = 0;
481 PXR_NAMESPACE_CLOSE_SCOPE
virtual AR_API std::string ComputeLocalPath(const std::string &path)=0
Returns the local path for the given path.
virtual AR_API bool CanCreateNewLayerWithIdentifier(const std::string &identifier, std::string *whyNot)=0
Returns true if a new file may be created using the given identifier, false otherwise.
AR_API ArResolver & ArGetUnderlyingResolver()
Returns the underlying ArResolver instance used by ArGetResolver.
virtual AR_API void EndCacheScope(VtValue *cacheScopeData)=0
Mark the end of a resolution caching scope.
AR_API std::vector< TfType > ArGetAvailableResolvers()
Returns list of TfTypes for available ArResolver subclasses.
virtual AR_API void RefreshContext(const ArResolverContext &context)=0
Refresh any caches associated with the given context.
virtual AR_API std::string Resolve(const std::string &path)=0
Returns the resolved filesystem path for the file identified by the given path if it exists...
virtual AR_API ArResolverContext CreateDefaultContextForAsset(const std::string &filePath)=0
Return a default ArResolverContext that may be bound to this resolver to resolve the asset located at...
virtual AR_API std::string GetExtension(const std::string &path)=0
Returns the normalized extension for the given path.
Interface for accessing the contents of an asset.
virtual AR_API ArResolverContext GetCurrentContext()=0
Returns the currently-bound asset resolver context.
virtual AR_API bool IsRepositoryPath(const std::string &path)=0
Returns true if the given path is a repository path.
virtual AR_API bool FetchToLocalResolvedPath(const std::string &path, const std::string &resolvedPath)=0
Fetch the asset identified by path to the filesystem location specified by resolvedPath.
virtual AR_API void UnbindContext(const ArResolverContext &context, VtValue *bindingData)=0
Unbind the given context from this resolver.
virtual AR_API bool IsRelativePath(const std::string &path)=0
Returns true if the given path is a relative path.
AR_API void ArSetPreferredResolver(const std::string &resolverTypeName)
Set the preferred ArResolver subclass used by ArGetResolver.
virtual AR_API void BeginCacheScope(VtValue *cacheScopeData)=0
Mark the start of a resolution caching scope.
AR_API ArResolver & ArGetResolver()
Returns the configured asset resolver.
virtual AR_API bool IsSearchPath(const std::string &path)=0
Returns whether this path is a search path.
virtual AR_API std::string ComputeNormalizedPath(const std::string &path)=0
Returns a normalized version of the given path.
virtual AR_API std::string ComputeRepositoryPath(const std::string &path)=0
Returns the computed repository path using the current resolver.
virtual AR_API bool CanWriteLayerToPath(const std::string &path, std::string *whyNot)=0
Returns true if a file may be written to the given path, false otherwise.
virtual AR_API void ConfigureResolverForAsset(const std::string &path)=0
Configures the resolver for a given asset path.
virtual AR_API std::string ResolveWithAssetInfo(const std::string &path, ArAssetInfo *assetInfo)=0
Returns the resolved filesystem path for the file identified by path following the same path resoluti...
virtual AR_API void UpdateAssetInfo(const std::string &identifier, const std::string &filePath, const std::string &fileVersion, ArAssetInfo *assetInfo)=0
Update assetInfo with respect to the given fileVersion .
virtual AR_API bool CreatePathForLayer(const std::string &path)=0
Create path needed to write a file to the given path.
virtual AR_API std::string AnchorRelativePath(const std::string &anchorPath, const std::string &path)=0
Returns the path formed by anchoring path to anchorPath.
virtual AR_API VtValue GetModificationTimestamp(const std::string &path, const std::string &resolvedPath)=0
Returns a value representing the last time the asset identified by path was modified.
virtual AR_API void BindContext(const ArResolverContext &context, VtValue *bindingData)=0
Binds the given context to this resolver.
TfType represents a dynamic runtime type.
virtual AR_API std::shared_ptr< ArAsset > OpenAsset(const std::string &resolvedPath)=0
Returns an ArAsset object for the asset located at resolvedPath.
An asset resolver context allows clients to provide additional data to the resolver for use during re...
AR_API std::unique_ptr< ArResolver > ArCreateResolver(const TfType &resolverType)
Construct an instance of the ArResolver subclass specified by resolverType.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
virtual AR_API ArResolverContext CreateDefaultContext()=0
Return a default ArResolverContext that may be bound to this resolver to resolve assets when no other...
Interface for the asset resolution system.
Contains information about a resolved asset.