Loading...
Searching...
No Matches
ArPackageResolver Class Referenceabstract

Interface for resolving assets within package assets. More...

#include <packageResolver.h>

Public Member Functions

 ArPackageResolver (const ArPackageResolver &)=delete
 
ArPackageResolveroperator= (const ArPackageResolver &)=delete
 
Packaged Path Resolution Operations
virtual AR_API std::string Resolve (const std::string &resolvedPackagePath, const std::string &packagedPath)=0
 Returns the resolved path for the asset located at packagedPath in the package specified by resolvedPackagePath if it exists.
 
Asset-specific Operations
virtual AR_API std::shared_ptr< ArAssetOpenAsset (const std::string &resolvedPackagePath, const std::string &resolvedPackagedPath)=0
 Returns an ArAsset object for the asset at resolvedPackagedPath located in the package asset at resolvedPackagePath.
 

Scoped Resolution Cache

These functions are called when scoped resolution caches are enabled via ArResolver.

See also
Scoped Resolution Cache
virtual AR_API void BeginCacheScope (VtValue *cacheScopeData)=0
 Mark the start of a resolution caching scope.
 
virtual AR_API void EndCacheScope (VtValue *cacheScopeData)=0
 Mark the end of a resolution caching scope.
 
AR_API ArPackageResolver ()
 

Detailed Description

Interface for resolving assets within package assets.

A package resolver is responsible for processing particular package asset formats and resolving information about assets stored within that package.

Each package resolver is associated with particular file formats and is invoked by asset resolution when handling package-relative paths involving those formats. ArPackageResolver instances are only used internally by Ar and are not directly exposed to clients.

Implementing a Package Resolver

To implement a package resolver, users must create a plugin containing a subclass of ArPackageResolver and register it with the plugin system so that it can be discovered and instantiated at runtime.

Definition at line 95 of file packageResolver.h.

Member Function Documentation

◆ BeginCacheScope()

virtual AR_API void BeginCacheScope ( VtValue cacheScopeData)
pure virtual

Mark the start of a resolution caching scope.

See also
ArResolver::BeginCacheScope

◆ EndCacheScope()

virtual AR_API void EndCacheScope ( VtValue cacheScopeData)
pure virtual

Mark the end of a resolution caching scope.

See also
ArResolver::EndCacheScope

◆ OpenAsset()

virtual AR_API std::shared_ptr< ArAsset > OpenAsset ( const std::string &  resolvedPackagePath,
const std::string &  resolvedPackagedPath 
)
pure virtual

Returns an ArAsset object for the asset at resolvedPackagedPath located in the package asset at resolvedPackagePath.

Returns an invalid std::shared_ptr if object could not be created.

See also
ArResolver::OpenAsset

◆ Resolve()

virtual AR_API std::string Resolve ( const std::string &  resolvedPackagePath,
const std::string &  packagedPath 
)
pure virtual

Returns the resolved path for the asset located at packagedPath in the package specified by resolvedPackagePath if it exists.

If the asset does not exist in the package, returns an empty string.

When ArResolver::Resolve is invoked on a package-relative path, the path will be parsed into the outermost package path, and the inner packaged path. The outermost package path will be resolved by the primary resolver. ArPackageResolver::Resolve will then be called on the corresponding package resolver with that resolved path and the inner packaged path. If the inner packaged path is itself a package-relative path, this process recurses until all paths have been resolved.

See also
ArResolver::Resolve

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