24#ifndef PXR_BASE_TF_PATTERN_MATCHER_H
25#define PXR_BASE_TF_PATTERN_MATCHER_H
32#include "pxr/base/tf/api.h"
33#include "pxr/base/arch/regex.h"
37PXR_NAMESPACE_OPEN_SCOPE
64 bool caseSensitive = false,
65 bool isGlob = false );
76 return _caseSensitive;
106 TF_API
bool Match(
const std::string &query,
107 std::string *errorMsg = NULL )
const;
122 void _Compile()
const;
126 std::string _pattern;
127 mutable bool _recompile;
128 mutable ArchRegex _regex;
132PXR_NAMESPACE_CLOSE_SCOPE
Class for matching regular expressions.
TF_API bool Match(const std::string &query, std::string *errorMsg=NULL) const
Returns true if query matches the matcher's pattern.
TF_API TfPatternMatcher()
Construct an empty (invalid) TfPatternMatcher.
TF_API void SetIsCaseSensitive(bool sensitive)
Set this matcher to match case-sensitively or not.
TF_API bool IsValid() const
Returns true if the matcher has a valid pattern.
bool IsCaseSensitive() const
Returns true if the matcher has been set to be case sensitive, false otherwise.
bool IsGlobPattern() const
Returns true if the matcher has been set to treat patterns as glob patterns, false otherwise.
TF_API const std::string & GetPattern() const
Returns the matcher's pattern string.
TF_API std::string GetInvalidReason() const
If IsValid() returns true, this will return the reason why (if any).
TF_API void SetPattern(const std::string &pattern)
Set the pattern that this matcher will use to match against.
TF_API void SetIsGlobPattern(bool isGlob)
Set this matcher to treat its pattern as a glob pattern.