#include <dSearchPath.h>
Public Member Functions | |
DSearchPath () | |
Creates an empty search path. | |
DSearchPath (const string &path, const string &delimiters=":\n\t") | |
DSearchPath (const DSearchPath ©) | |
void | operator= (const DSearchPath ©) |
~DSearchPath () | |
void | clear () |
Removes all the directories from the search list. | |
void | append_directory (const Filename &directory) |
Adds a new directory to the end of the search list. | |
void | prepend_directory (const Filename &directory) |
Adds a new directory to the front of the search list. | |
void | append_path (const string &path, const string &delimiters=":\n\t") |
Adds all of the directories listed in the search path to the end of the search list. | |
void | append_path (const DSearchPath &path) |
Adds all of the directories listed in the search path to the end of the search list. | |
void | prepend_path (const DSearchPath &path) |
Adds all of the directories listed in the search path to the beginning of the search list. | |
bool | is_empty () const |
Returns true if the search list is empty, false otherwise. | |
int | get_num_directories () const |
Returns the number of directories on the search list. | |
const Filename & | get_directory (int n) const |
Returns the nth directory on the search list. | |
Filename | find_file (const Filename &filename) const |
Searches all the directories in the search list for the indicated file, in order. | |
int | find_all_files (const Filename &filename, Results &results) const |
Searches all the directories in the search list for the indicated file, in order. | |
void | output (ostream &out, const string &separator=":") const |
void | write (ostream &out, int indent_level=0) const |
Static Public Member Functions | |
Filename | search_path (const Filename &filename, const string &path, const string &delimiters=":\n\t") |
A quick-and-easy way to search a searchpath for a file when you don't feel like building or keeping around a DSearchPath object. | |
Private Types | |
typedef pvector< Filename > | Directories |
Private Attributes | |
Directories | _directories |
It is normally constructed by passing it a traditional searchpath-style string, e.g. a list of directory names delimited by spaces or colons, but it can also be built up explicitly.
Definition at line 47 of file dSearchPath.h.
|
Definition at line 98 of file dSearchPath.h. |
|
Creates an empty search path.
Definition at line 136 of file dSearchPath.cxx. References _directories. |
|
Definition at line 147 of file dSearchPath.cxx. |
|
Definition at line 159 of file dSearchPath.cxx. References _directories. |
|
Definition at line 184 of file dSearchPath.cxx. References _directories, path, and size_t. |
|
Adds a new directory to the end of the search list.
Definition at line 209 of file dSearchPath.cxx. References _directories, and path. |
|
Adds all of the directories listed in the search path to the end of the search list.
Definition at line 263 of file dSearchPath.cxx. |
|
Adds all of the directories listed in the search path to the end of the search list.
Definition at line 237 of file dSearchPath.cxx. References _directories. Referenced by Config::ConfigTable::ReadConfigFile(). |
|
Removes all the directories from the search list.
Definition at line 196 of file dSearchPath.cxx. |
|
Searches all the directories in the search list for the indicated file, in order. Fills up the results list with *all* of the matching filenames found, if any. Returns the number of matches found. It is the responsibility of the the caller to clear the results list first; otherwise, the newly-found files will be appended to the list. Definition at line 391 of file dSearchPath.cxx. |
|
Searches all the directories in the search list for the indicated file, in order. Returns the full matching pathname of the first match if found, or the empty string if not found. Definition at line 345 of file dSearchPath.cxx. References _directories. Referenced by Filename::is_regular_file(), and InterrogateDatabase::remap_indices(). |
|
Returns the nth directory on the search list.
Definition at line 325 of file dSearchPath.cxx. Referenced by Filename::compare_timestamps(). |
|
Returns the number of directories on the search list.
Definition at line 312 of file dSearchPath.cxx. References _directories, Filename::exists(), and Filename::is_fully_qualified(). Referenced by Filename::compare_timestamps(). |
|
Returns true if the search list is empty, false otherwise.
Definition at line 299 of file dSearchPath.cxx. |
|
Definition at line 172 of file dSearchPath.cxx. References _directories. |
|
Definition at line 426 of file dSearchPath.cxx. |
|
Adds a new directory to the front of the search list.
Definition at line 222 of file dSearchPath.cxx. References _directories, and path. |
|
Adds all of the directories listed in the search path to the beginning of the search list.
Definition at line 279 of file dSearchPath.cxx. References Filename::is_fully_qualified(). |
|
A quick-and-easy way to search a searchpath for a file when you don't feel like building or keeping around a DSearchPath object. This simply constructs a temporary DSearchPath based on the indicated path string, and searches that. Definition at line 40 of file dSearchPath.I. |
|
Definition at line 446 of file dSearchPath.cxx. |
|
Definition at line 99 of file dSearchPath.h. Referenced by DSearchPath::Results::add_file(), append_directory(), append_path(), DSearchPath(), find_file(), get_num_directories(), operator=(), prepend_directory(), and ~DSearchPath(). |