18 #include "pandatoolbase.h" 19 #include "pathStore.h" 20 #include "referenceCount.h" 21 #include "globPattern.h" 23 #include "dSearchPath.h" 49 INLINE
void add_pattern(
const string &orig_prefix,
const string &replacement_prefix);
69 void write(ostream &out,
int indent_level = 0)
const;
76 PathStore _path_store;
92 bool copy_this_file(
Filename &filename);
96 INLINE Component(
const string &component);
97 INLINE Component(
const Component ©);
98 INLINE
void operator = (
const Component ©);
107 Entry(
const string &orig_prefix,
const string &replacement_prefix);
108 INLINE Entry(
const Entry ©);
109 INLINE
void operator = (
const Entry ©);
112 size_t r_try_match(
const vector_string &components,
size_t oi,
size_t ci)
const;
115 Components _orig_components;
117 string _replacement_prefix;
126 Copied _orig_to_target;
127 Copied _target_to_orig;
130 #include "pathReplace.I" 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 ma...
const string & get_orig_prefix(int n) const
Returns the original prefix associated with the nth pattern.
void full_convert_path(const Filename &orig_filename, const DSearchPath &additional_path, Filename &resolved_path, Filename &output_path)
Converts the input path into two different forms: A resolved path, and an output path.
int get_num_patterns() const
Returns the number of original/replace patterns that have been added.
const string & get_replacement_prefix(int n) const
Returns the replacement prefix associated with the nth pattern.
The name of a file, such as a texture file or an Egg file.
A base class for all things that want to be reference-counted.
bool is_empty() const
Returns true if the PathReplace object specifies no action, or false if convert_path() may do somethi...
void clear()
Removes all the patterns from the specification.
This encapsulates the user's command-line request to replace existing, incorrect pathnames to models ...
This class stores a list of directories that can be searched, in order, to locate a particular file...
void add_pattern(const string &orig_prefix, const string &replacement_prefix)
Adds the indicated original/replace pattern to the specification.
void clear_error()
Resets the error flag to the no-error state.
bool had_error() const
Returns true if an error was detected since the last call to clear_error(), false otherwise...
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_direct...
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 ...
This class can be used to test for string matches against standard Unix-shell filename globbing conve...