Panda3D
|
This class stores a list of directories that can be searched, in order, to locate a particular file. More...
Classes | |
class | Results |
Public Member Functions | |
__init__ () | |
__init__ (const DSearchPath copy) | |
__init__ (const Filename directory) | |
__init__ (DSearchPath from) | |
__init__ (str path, str separator) | |
appendDirectory (const Filename directory) | |
Adds a new directory to the end of the search list. More... | |
appendPath (const DSearchPath path) | |
Adds all of the directories listed in the search path to the end of the search list. More... | |
appendPath (str path, str separator) | |
Adds all of the directories listed in the search path to the end of the search list. More... | |
clear () | |
Removes all the directories from the search list. More... | |
DSearchPath::Results | findAllFiles (const Filename filename) |
This variant of find_all_files() returns the new Results object, instead of filling on in on the parameter list. More... | |
int | findAllFiles (const Filename filename, DSearchPath::Results results) |
Searches all the directories in the search list for the indicated file, in order. More... | |
Filename | findFile (const Filename filename) |
Searches all the directories in the search list for the indicated file, in order. More... | |
list | getDirectories () |
const Filename | getDirectory (int n) |
Returns the nth directory on the search list. More... | |
int | getNumDirectories () |
Returns the number of directories on the search list. More... | |
bool | isEmpty () |
Returns true if the search list is empty, false otherwise. More... | |
DSearchPath | operator= (const DSearchPath copy) |
DSearchPath | operator= (DSearchPath from) |
output (Ostream out, str separator) | |
prependDirectory (const Filename directory) | |
Adds a new directory to the front of the search list. More... | |
prependPath (const DSearchPath path) | |
Adds all of the directories listed in the search path to the beginning of the search list. More... | |
write (Ostream out, int indent_level) | |
Static Public Member Functions | |
static Filename | searchPath (const Filename filename, str path, str separator) |
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. More... | |
Public Attributes | |
const Filename | directories [] |
Returns the nth directory on the search list. More... | |
This class stores a list of directories that can be searched, in order, to locate a particular file.
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.
__init__ | ( | ) |
__init__ | ( | const DSearchPath | copy | ) |
__init__ | ( | const Filename | directory | ) |
__init__ | ( | DSearchPath | from | ) |
__init__ | ( | str | path, |
str | separator | ||
) |
appendDirectory | ( | const Filename | directory | ) |
Adds a new directory to the end of the search list.
appendPath | ( | const DSearchPath | path | ) |
Adds all of the directories listed in the search path to the end of the search list.
appendPath | ( | str | path, |
str | separator | ||
) |
Adds all of the directories listed in the search path to the end of the search list.
clear | ( | ) |
Removes all the directories from the search list.
DSearchPath::Results findAllFiles | ( | const Filename | filename | ) |
This variant of find_all_files() returns the new Results object, instead of filling on in on the parameter list.
This is a little more convenient to call from Python.
int findAllFiles | ( | const Filename | filename, |
DSearchPath::Results | results | ||
) |
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.
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.
list getDirectories | ( | ) |
const Filename getDirectory | ( | int | n | ) |
Returns the nth directory on the search list.
int getNumDirectories | ( | ) |
Returns the number of directories on the search list.
bool isEmpty | ( | ) |
Returns true if the search list is empty, false otherwise.
DSearchPath operator= | ( | const DSearchPath | copy | ) |
DSearchPath operator= | ( | DSearchPath | from | ) |
output | ( | Ostream | out, |
str | separator | ||
) |
prependDirectory | ( | const Filename | directory | ) |
Adds a new directory to the front of the search list.
prependPath | ( | const DSearchPath | path | ) |
Adds all of the directories listed in the search path to the beginning of the search list.
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.
write | ( | Ostream | out, |
int | indent_level | ||
) |
const Filename directories[] |
Returns the nth directory on the search list.