All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ArDefaultResolverContext Class Reference

#include <defaultResolverContext.h>

Public Member Functions

 ArDefaultResolverContext ()=default
 Default construct a context with no search path. More...
AR_API ArDefaultResolverContext (const std::vector< std::string > &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. More...
AR_API std::string GetAsString () const
 Return a string representation of this context for debugging. More...

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.

Definition at line 63 of file defaultResolverContext.h.

Constructor & Destructor Documentation

ArDefaultResolverContext::ArDefaultResolverContext ( )

Default construct a context with no search path.

AR_API ArDefaultResolverContext::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

AR_API std::string ArDefaultResolverContext::GetAsString ( ) const

Return a string representation of this context for debugging.

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

Return this context's search path.

Definition at line 79 of file defaultResolverContext.h.

AR_API bool ArDefaultResolverContext::operator< ( const ArDefaultResolverContext rhs) const
AR_API bool ArDefaultResolverContext::operator== ( const ArDefaultResolverContext rhs) const

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