#include <findApproxPath.h>
Public Member Functions | |
FindApproxPath () | |
bool | add_string (const string &str_path) |
Adds a sequence of components separated by slashes, followed optionally by a semicolon and a sequence of control flags, to the path sequence. | |
bool | add_flags (const string &str_flags) |
Adds a sequence of control flags. | |
bool | add_component (string str_component) |
Adds a single component to the path sequence, defined by a string as might appear between slashes in the path string. | |
void | add_match_name (const string &name, int flags) |
Adds a component that must match the name of a node exactly. | |
void | add_match_name_glob (const string &glob, int flags) |
Adds a component that must match the name of a node using standard shell globbing rules, with wildcard characters accepted. | |
void | add_match_exact_type (TypeHandle type, int flags) |
Adds a component that must match the type of a node exactly, with no derived types matching. | |
void | add_match_inexact_type (TypeHandle type, int flags) |
Adds a component that must match the type of a node or be a base class of the node's type. | |
void | add_match_one (int flags) |
Adds a component that will match any node (but not a chain of many nodes). | |
void | add_match_many (int flags) |
Adds a component that will match a chain of zero or more consecutive nodes. | |
void | add_match_pointer (PandaNode *pointer, int flags) |
Adds a component that must match a particular node exactly, by pointer. | |
int | get_num_components () const |
Returns the number of components in the path. | |
bool | is_component_match_many (int index) const |
Returns true if the nth component is of type match_many, which will require special handling. | |
bool | matches_component (int index, PandaNode *node) const |
Returns true if the nth component of the path matches the indicated node, false otherwise. | |
bool | matches_stashed (int index) const |
Returns true if the nth component of the path matches a stashed node only, false otherwise. | |
bool | return_hidden () const |
Returns true if this path allows returning of hidden nodes, false otherwise. | |
bool | return_stashed () const |
Returns true if this path allows returning of stashed nodes, false otherwise. | |
void | output (ostream &out) const |
void | output_component (ostream &out, int index) const |
Formats the nth component of the path to the indicated output stream. | |
Private Types | |
typedef pvector< Component > | Path |
enum | ComponentType { CT_match_name, CT_match_name_glob, CT_match_exact_type, CT_match_inexact_type, CT_match_one, CT_match_many, CT_match_pointer } |
enum | ComponentFlags { CF_stashed = 0x001 } |
Private Attributes | |
Path | _path |
bool | _return_hidden |
bool | _return_stashed |
Friends | |
ostream & | operator<< (ostream &, FindApproxPath::ComponentType) |
ostream & | operator<< (ostream &, const FindApproxPath::Component &) |
It chops a string path, as supplied to find_up() or find_down(), and breaks it up into its component pieces.
Definition at line 45 of file findApproxPath.h.
|
Definition at line 102 of file findApproxPath.h. |
|
Definition at line 86 of file findApproxPath.h. |
|
Definition at line 77 of file findApproxPath.h. |
|
Definition at line 31 of file findApproxPath.I. References FindApproxPath::Component::_flags, FindApproxPath::Component::_name, _path, FindApproxPath::Component::_type, CT_match_name, and INLINE. |
|
Adds a single component to the path sequence, defined by a string as might appear between slashes in the path string. Returns true if successful, false if the string component was in some way invalid. Definition at line 223 of file findApproxPath.cxx. |
|
Adds a sequence of control flags. This will be a sequence of letters preceded by either '+' or '-', with no intervening punctuation. Returns true if successful, false otherwise. Definition at line 162 of file findApproxPath.cxx. |
|
Adds a component that must match the type of a node exactly, with no derived types matching.
Definition at line 87 of file findApproxPath.I. References _path. |
|
Adds a component that must match the type of a node or be a base class of the node's type.
Definition at line 106 of file findApproxPath.I. References FindApproxPath::Component::_flags, _path, FindApproxPath::Component::_type, CT_match_many, and INLINE. |
|
Adds a component that will match a chain of zero or more consecutive nodes.
Definition at line 143 of file findApproxPath.I. |
|
Adds a component that must match the name of a node exactly.
Definition at line 47 of file findApproxPath.I. References FindApproxPath::Component::_flags, FindApproxPath::Component::_name, _path, FindApproxPath::Component::_type, CT_match_name_glob, and INLINE. |
|
Adds a component that must match the name of a node using standard shell globbing rules, with wildcard characters accepted.
Definition at line 68 of file findApproxPath.I. References FindApproxPath::Component::_flags, _path, FindApproxPath::Component::_type, FindApproxPath::Component::_type_handle, CT_match_exact_type, and INLINE. |
|
Adds a component that will match any node (but not a chain of many nodes).
Definition at line 125 of file findApproxPath.I. References FindApproxPath::Component::_flags, _path, FindApproxPath::Component::_pointer, FindApproxPath::Component::_type, CT_match_pointer, and INLINE. |
|
Adds a component that must match a particular node exactly, by pointer.
Definition at line 161 of file findApproxPath.I. |
|
Adds a sequence of components separated by slashes, followed optionally by a semicolon and a sequence of control flags, to the path sequence. Returns true if successful, false if the string contained an error. Definition at line 115 of file findApproxPath.cxx. Referenced by NodePathCollection::get_num_paths(), and NodePath::set_billboard_axis(). |
|
Returns the number of components in the path.
Definition at line 178 of file findApproxPath.I. References _path, and CF_stashed. |
|
Returns true if the nth component is of type match_many, which will require special handling.
Definition at line 193 of file findApproxPath.I. |
|
Returns true if the nth component of the path matches the indicated node, false otherwise.
Definition at line 209 of file findApproxPath.I. |
|
Returns true if the nth component of the path matches a stashed node only, false otherwise.
Definition at line 225 of file findApproxPath.I. Referenced by FindApproxLevelEntry::operator=(). |
|
Definition at line 294 of file findApproxPath.cxx. References CT_match_many, CT_match_one, and CT_match_pointer. |
|
Formats the nth component of the path to the indicated output stream.
Definition at line 274 of file findApproxPath.I. |
|
Returns true if this path allows returning of hidden nodes, false otherwise.
Definition at line 244 of file findApproxPath.I. |
|
Returns true if this path allows returning of stashed nodes, false otherwise.
Definition at line 259 of file findApproxPath.I. |
|
Definition at line 116 of file findApproxPath.h. |
|
Definition at line 309 of file findApproxPath.cxx. |
|
Definition at line 103 of file findApproxPath.h. Referenced by add_match_exact_type(), add_match_inexact_type(), add_match_name(), add_match_name_glob(), add_match_one(), add_match_pointer(), FindApproxPath(), get_num_components(), and matches_component(). |
|
Definition at line 105 of file findApproxPath.h. |
|
Definition at line 106 of file findApproxPath.h. |