All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
defaultResolverContext.h
Go to the documentation of this file.
1//
2// Copyright 2018 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_USD_AR_DEFAULT_RESOLVER_CONTEXT_H
8#define PXR_USD_AR_DEFAULT_RESOLVER_CONTEXT_H
9
11
12#include "pxr/pxr.h"
13#include "pxr/usd/ar/api.h"
15
16#include <string>
17#include <vector>
18
19PXR_NAMESPACE_OPEN_SCOPE
20
47{
48public:
51
55 AR_API ArDefaultResolverContext(const std::vector<std::string>& searchPath);
56
57 AR_API bool operator<(const ArDefaultResolverContext& rhs) const;
58 AR_API bool operator==(const ArDefaultResolverContext& rhs) const;
59 AR_API bool operator!=(const ArDefaultResolverContext& rhs) const;
60
62 const std::vector<std::string>& GetSearchPath() const
63 {
64 return _searchPath;
65 }
66
68 AR_API std::string GetAsString() const;
69
70private:
71 std::vector<std::string> _searchPath;
72};
73
74AR_API size_t
75hash_value(const ArDefaultResolverContext& context);
76
77inline std::string
78ArGetDebugString(const ArDefaultResolverContext& context)
79{
80 return context.GetAsString();
81}
82
84
85PXR_NAMESPACE_CLOSE_SCOPE
86
87#endif // PXR_USD_AR_DEFAULT_RESOLVER_CONTEXT_H
Resolver context object that specifies a search path to use during asset resolution.
ArDefaultResolverContext()=default
Default construct a context with no search path.
const std::vector< std::string > & GetSearchPath() const
Return this context's search path.
AR_API ArDefaultResolverContext(const std::vector< std::string > &searchPath)
Construct a context with the given searchPath.
AR_API std::string GetAsString() const
Return a string representation of this context for debugging.
Macros for defining an object for use with ArResolverContext.
#define AR_DECLARE_RESOLVER_CONTEXT(ContextObject)
Declare that the specified ContextObject type may be used as an asset resolver context object for ArR...