#include <pathReplace.h>
Inheritance diagram for PathReplace:
Public Member Functions | |
PathReplace () | |
~PathReplace () | |
void | clear () |
Removes all the patterns from the specification. | |
void | add_pattern (const string &orig_prefix, const string &replacement_prefix) |
Adds the indicated original/replace pattern to the specification. | |
int | get_num_patterns () const |
Returns the number of original/replace patterns that have been added. | |
const string & | get_orig_prefix (int n) const |
Returns the original prefix associated with the nth pattern. | |
const string & | get_replacement_prefix (int n) const |
Returns the replacement prefix associated with the nth pattern. | |
bool | is_empty () const |
Returns true if the PathReplace object specifies no action, or false if convert_path() may do something. | |
Filename | match_path (const Filename &orig_filename, const DSearchPath &additional_path=DSearchPath()) |
Looks for a match for the given filename among all the replacement patterns, and returns the first match found. | |
Filename | store_path (const Filename &orig_filename) |
Given a path to an existing filename, converts it as specified in the _path_store and or _path_directory properties to a form suitable for storing in an output file. | |
Filename | convert_path (const Filename &orig_filename, const DSearchPath &additional_path=DSearchPath()) |
Calls match_path() followed by store_path(), to replace the initial prefix and then convert the file for storing, as the user indicated. | |
void | write (ostream &out, int indent_level=0) const |
int | get_ref_count () const |
int | ref () const |
int | unref () const |
void | test_ref_count_integrity () const |
Static Public Member Functions | |
TypeHandle | get_class_type () |
void | init_type () |
Public Attributes | |
DSearchPath | _path |
PathStore | _path_store |
Filename | _path_directory |
Protected Attributes | |
int | _ref_count |
Static Protected Attributes | |
TypeHandle | _type_handle |
Private Types | |
typedef pvector< Component > | Components |
typedef pvector< Entry > | Entries |
Private Attributes | |
Entries | _entries |
It corresponds to a sequence of -pr command-line options, as well as the -pp option.
This can also go the next step, which is to convert a known file into a suitable form for storing in a model file. In this capacity, it corresponds to the -ps and -pd options.
Definition at line 58 of file pathReplace.h.
|
Definition at line 99 of file pathReplace.h. |
|
Definition at line 116 of file pathReplace.h. |
|
Definition at line 34 of file pathReplace.cxx. |
|
Definition at line 46 of file pathReplace.cxx. References _entries, and PathReplace::Entry::try_match(). |
|
Adds the indicated original/replace pattern to the specification. If a filename is encountered whose initial prefix matches the indicated orig_prefix, that prefix will be replaced with replacement_prefix. Definition at line 51 of file pathReplace.I. References _entries. Referenced by ProgramBase::dispatch_double_quad(). |
|
Removes all the patterns from the specification.
Definition at line 32 of file pathReplace.I. |
|
Calls match_path() followed by store_path(), to replace the initial prefix and then convert the file for storing, as the user indicated.
Definition at line 130 of file pathReplace.I. References PathReplace::Component::_double_star, PathReplace::Component::_orig_prefix, and INLINE. |
|
Returns the number of original/replace patterns that have been added.
Definition at line 66 of file pathReplace.I. |
|
Returns the original prefix associated with the nth pattern.
Definition at line 81 of file pathReplace.I. References _entries, _path, _path_store, INLINE, DSearchPath::is_empty(), and PS_keep. |
|
Returns the replacement prefix associated with the nth pattern.
Definition at line 97 of file pathReplace.I. References match_path(), and store_path(). |
|
Returns true if the PathReplace object specifies no action, or false if convert_path() may do something.
Definition at line 113 of file pathReplace.I. References INLINE. |
|
Looks for a match for the given filename among all the replacement patterns, and returns the first match found. If additional_path is nonempty, it is an additional search path on which to look for the file. The model_path is always implicitly searched. Definition at line 66 of file pathReplace.cxx. Referenced by get_replacement_prefix(). |
|
Given a path to an existing filename, converts it as specified in the _path_store and or _path_directory properties to a form suitable for storing in an output file.
Definition at line 147 of file pathReplace.cxx. References PS_invalid, PS_keep, and PS_strip. Referenced by get_replacement_prefix(). |
|
Definition at line 191 of file pathReplace.cxx. |
|
Definition at line 117 of file pathReplace.h. Referenced by add_pattern(), clear(), get_num_patterns(), get_orig_prefix(), and ~PathReplace(). |
|
Definition at line 83 of file pathReplace.h. Referenced by get_orig_prefix(). |
|
Definition at line 87 of file pathReplace.h. |
|
Definition at line 86 of file pathReplace.h. Referenced by get_orig_prefix(). |