HDK
|
#include <pathPattern.h>
Classes | |
struct | Component |
Public Member Functions | |
SDF_API | SdfPathPattern () |
SDF_API | SdfPathPattern (SdfPath const &prefix) |
Construct a SdfPathPattern with the prefix path. More... | |
SDF_API | SdfPathPattern (SdfPath &&prefix) |
Construct a SdfPathPattern with the prefix path. More... | |
bool | CanAppendChild (std::string const &text, std::string *reason=nullptr) const |
SDF_API bool | CanAppendChild (std::string const &text, SdfPredicateExpression const &predExpr, std::string *reason=nullptr) const |
SDF_API SdfPathPattern & | AppendChild (std::string const &text, SdfPredicateExpression &&predExpr) |
SDF_API SdfPathPattern & | AppendChild (std::string const &text, SdfPredicateExpression const &predExpr) |
SDF_API SdfPathPattern & | AppendChild (std::string const &text) |
bool | CanAppendProperty (std::string const &text, std::string *reason=nullptr) const |
SDF_API bool | CanAppendProperty (std::string const &text, SdfPredicateExpression const &predExpr, std::string *reason=nullptr) const |
SDF_API SdfPathPattern & | AppendProperty (std::string const &text, SdfPredicateExpression &&predExpr) |
SDF_API SdfPathPattern & | AppendProperty (std::string const &text, SdfPredicateExpression const &predExpr) |
SDF_API SdfPathPattern & | AppendProperty (std::string const &text) |
SdfPath const & | GetPrefix () const & |
SdfPath | GetPrefix ()&& |
SDF_API SdfPathPattern & | SetPrefix (SdfPath &&p) |
SdfPathPattern & | SetPrefix (SdfPath const &p) |
SDF_API bool | HasLeadingStretch () const |
SDF_API bool | HasTrailingStretch () const |
SDF_API SdfPathPattern & | AppendStretchIfPossible () |
SDF_API SdfPathPattern & | RemoveTrailingStretch () |
SDF_API SdfPathPattern & | RemoveTrailingComponent () |
SDF_API std::string | GetText () const |
Return the string representation of this pattern. More... | |
std::vector< Component > const & | GetComponents () const & |
std::vector< Component > | GetComponents ()&& |
std::vector < SdfPredicateExpression > const & | GetPredicateExprs () const & |
std::vector < SdfPredicateExpression > | GetPredicateExprs ()&& |
bool | IsProperty () const |
operator bool () const | |
Return true if this pattern is not empty, false if it is. More... | |
Static Public Member Functions | |
static SDF_API SdfPathPattern const & | Everything () |
Return the pattern "//" which matches all paths. More... | |
static SDF_API SdfPathPattern const & | EveryDescendant () |
static SdfPathPattern | Nothing () |
Return a default constructed SdfPathPattern that matches nothing. More... | |
Friends | |
template<class HashState > | |
void | TfHashAppend (HashState &h, SdfPathPattern const &pat) |
bool | operator== (SdfPathPattern const &l, SdfPathPattern const &r) |
bool | operator!= (SdfPathPattern const &l, SdfPathPattern const &r) |
void | swap (SdfPathPattern &l, SdfPathPattern &r) |
Objects of this class represent SdfPath matching patterns, consisting of an SdfPath prefix followed by a sequence of components, which may contain wildcards and optional embedded predicate expressions (see SdfPredicateExpression).
Definition at line 30 of file pathPattern.h.
SDF_API SdfPathPattern::SdfPathPattern | ( | ) |
Construct the empty pattern whose bool-conversion operator returns false.
Construct a SdfPathPattern with the prefix
path.
Construct a SdfPathPattern with the prefix
path.
SDF_API SdfPathPattern& SdfPathPattern::AppendChild | ( | std::string const & | text, |
SdfPredicateExpression && | predExpr | ||
) |
Append a prim child component to this pattern, with optional predicate expression predExpr
. If this pattern does not yet contain any wildcards or components with predicate expressions, and the input text does not contain wildcards, and predExpr
is empty, then append a child component to this pattern's prefix path (see GetPrefix()). Otherwise append this component to the sequence of components. Return *this.
SDF_API SdfPathPattern& SdfPathPattern::AppendChild | ( | std::string const & | text, |
SdfPredicateExpression const & | predExpr | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
SDF_API SdfPathPattern& SdfPathPattern::AppendChild | ( | std::string const & | text | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
SDF_API SdfPathPattern& SdfPathPattern::AppendProperty | ( | std::string const & | text, |
SdfPredicateExpression && | predExpr | ||
) |
Append a prim property component to this pattern, with optional predicate expression predExpr
. If this pattern does not yet contain any wildcards or components with predicate expressions, and the input text does not contain wildcards, and predExpr
is empty, then append a property component to this pattern's prefix path (see GetPrefix()). Otherwise append this component to the sequence of components. Return *this.
SDF_API SdfPathPattern& SdfPathPattern::AppendProperty | ( | std::string const & | text, |
SdfPredicateExpression const & | predExpr | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
SDF_API SdfPathPattern& SdfPathPattern::AppendProperty | ( | std::string const & | text | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
SDF_API SdfPathPattern& SdfPathPattern::AppendStretchIfPossible | ( | ) |
Append a stretch component (i.e. //
) to this pattern if it's possible to do so. Otherwise do nothing. It is not possible to append a stretch component to a pattern that already ends in a stretch component, or a pattern that identifies a property. Return *this.
|
inline |
Return true if it is valid to append the child element text
to this pattern. If not, and reason
is not nullptr, set it to an explanatory reason why not.
Definition at line 99 of file pathPattern.h.
SDF_API bool SdfPathPattern::CanAppendChild | ( | std::string const & | text, |
SdfPredicateExpression const & | predExpr, | ||
std::string * | reason = nullptr |
||
) | const |
Return true if it is valid to append the child element text
and predExpr
to this pattern. If not, and reason
is not nullptr, set it to an explanatory reason why not.
|
inline |
Return true if it is valid to append the property element text
to this pattern. If not, and reason
is not nullptr, set it to an explanatory reason why not.
Definition at line 133 of file pathPattern.h.
SDF_API bool SdfPathPattern::CanAppendProperty | ( | std::string const & | text, |
SdfPredicateExpression const & | predExpr, | ||
std::string * | reason = nullptr |
||
) | const |
Return true if it is valid to append the property element text
and predExpr
to this pattern. If not, and reason
is not nullptr, set it to an explanatory reason why not.
|
static |
Return the pattern ".//" which matches all paths descendant to an anchor path.
|
static |
Return the pattern "//" which matches all paths.
|
inline |
Return this pattern's components that follow its non-speculative prefix path.
Definition at line 220 of file pathPattern.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 225 of file pathPattern.h.
|
inline |
Return the predicate expressions used by this pattern. These are indexed by a Component's predicateIndex member, if it is not -1.
Definition at line 232 of file pathPattern.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 238 of file pathPattern.h.
|
inline |
Return this pattern's non-speculative prefix (leading path components with no wildcards and no predicates).
Definition at line 166 of file pathPattern.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 171 of file pathPattern.h.
SDF_API std::string SdfPathPattern::GetText | ( | ) | const |
Return the string representation of this pattern.
SDF_API bool SdfPathPattern::HasLeadingStretch | ( | ) | const |
Return true if this pattern's prefix is the absolute root path and and its first component is a stretch component – that is, the pattern starts with //
, false otherwise.
SDF_API bool SdfPathPattern::HasTrailingStretch | ( | ) | const |
Return true if this pattern ends with a stretch component: //
, false otherwise.
|
inline |
Return true if this pattern identifies properties exclusively, false otherwise.
Definition at line 244 of file pathPattern.h.
|
inlinestatic |
Return a default constructed SdfPathPattern that matches nothing.
Definition at line 56 of file pathPattern.h.
|
inlineexplicit |
Return true if this pattern is not empty, false if it is.
Definition at line 249 of file pathPattern.h.
SDF_API SdfPathPattern& SdfPathPattern::RemoveTrailingComponent | ( | ) |
If this pattern has components, remove the final component. Otherwise do nothing. Return *this. To inspect and modify the prefix path, use GetPrefix(), SetPrefix().
SDF_API SdfPathPattern& SdfPathPattern::RemoveTrailingStretch | ( | ) |
Remove trailing stretch from this pattern if it has trailing stretch. Otherwise do nothing. Return *this. See HasTrailingStretch().
SDF_API SdfPathPattern& SdfPathPattern::SetPrefix | ( | SdfPath && | p | ) |
Set this pattern's non-speculative prefix (leading path components with no wildcards and no predicates). Return *this.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 181 of file pathPattern.h.
|
friend |
Definition at line 274 of file pathPattern.h.
|
friend |
Definition at line 266 of file pathPattern.h.
|
friend |
Definition at line 278 of file pathPattern.h.
|
friend |
Definition at line 260 of file pathPattern.h.