Loading...
Searching...
No Matches
ArDefaultResolverContext Class Reference

Resolver context object that specifies a search path to use during asset resolution. More...

#include <defaultResolverContext.h>

Public Member Functions

 ArDefaultResolverContext ()=default
 Default construct a context with no search path.
 
AR_API ArDefaultResolverContext (const std::vector< std::string > &searchPath)
 Construct a context with the given searchPath.
 
AR_API bool operator< (const ArDefaultResolverContext &rhs) const
 
AR_API bool operator== (const ArDefaultResolverContext &rhs) const
 
AR_API bool operator!= (const ArDefaultResolverContext &rhs) const
 
const std::vector< std::string > & GetSearchPath () const
 Return this context's search path.
 
AR_API std::string GetAsString () const
 Return a string representation of this context for debugging.
 

Detailed Description

Resolver context object that specifies a search path to use during asset resolution.

This object is intended for use with the default ArDefaultResolver asset resolution implementation; see documentation for that class for more details on the search path resolution algorithm.

Example usage:

ArDefaultResolverContext ctx({"/Local/Models", "/Installed/Models"});
{
// Bind the context object:
// While the context is bound, all calls to ArResolver::Resolve
// (assuming ArDefaultResolver is the underlying implementation being
// used) will include the specified paths during resolution.
std::string resolvedPath = resolver.Resolve("ModelName/File.txt")
}
// Once the context is no longer bound (due to the ArResolverContextBinder
// going out of scope), its search path no longer factors into asset
// resolution.
Resolver context object that specifies a search path to use during asset resolution.
Helper object for managing the binding and unbinding of ArResolverContext objects with the asset reso...

Definition at line 63 of file defaultResolverContext.h.

Constructor & Destructor Documentation

◆ ArDefaultResolverContext() [1/2]

Default construct a context with no search path.

◆ ArDefaultResolverContext() [2/2]

AR_API ArDefaultResolverContext ( const std::vector< std::string > &  searchPath)

Construct a context with the given searchPath.

Elements in searchPath should be absolute paths. If they are not, they will be anchored to the current working directory.

Member Function Documentation

◆ GetAsString()

AR_API std::string GetAsString ( ) const

Return a string representation of this context for debugging.

◆ GetSearchPath()

const std::vector< std::string > & GetSearchPath ( ) const
inline

Return this context's search path.

Definition at line 79 of file defaultResolverContext.h.


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