21 INLINE ConfigVariableSearchPath::
22 ConfigVariableSearchPath(
const string &name,
23 const string &description,
int flags) :
24 #ifdef PRC_SAVE_DESCRIPTIONS
30 _local_modified(initial_invalid_cache())
36 _core->set_default_value(
"");
46 INLINE ConfigVariableSearchPath::
47 ConfigVariableSearchPath(
const string &name,
49 const string &description,
int flags) :
50 #ifdef PRC_SAVE_DESCRIPTIONS
55 _default_value(default_value),
56 _local_modified(initial_invalid_cache())
62 _core->set_default_value(
"");
72 INLINE ConfigVariableSearchPath::
73 ConfigVariableSearchPath(
const string &name,
74 const string &default_value,
75 const string &description,
int flags) :
76 #ifdef PRC_SAVE_DESCRIPTIONS
81 _default_value(
Filename(default_value)),
82 _local_modified(initial_invalid_cache())
88 _core->set_default_value(
"");
98 INLINE ConfigVariableSearchPath::
99 ~ConfigVariableSearchPath() {
107 INLINE ConfigVariableSearchPath::
117 INLINE
const DSearchPath &ConfigVariableSearchPath::
119 TAU_PROFILE(
"const DSearchPath &ConfigVariableSearchPath::get_value() const",
" ", TAU_USER);
120 if (!is_cache_valid(_local_modified)) {
131 INLINE
const DSearchPath &ConfigVariableSearchPath::
132 get_default_value()
const {
133 return _default_value;
150 if (_core->clear_local_value()) {
154 _local_modified = initial_invalid_cache();
177 _local_modified = initial_invalid_cache();
188 _local_modified = initial_invalid_cache();
200 _local_modified = initial_invalid_cache();
212 _local_modified = initial_invalid_cache();
224 _local_modified = initial_invalid_cache();
307 INLINE
void ConfigVariableSearchPath::
308 output(ostream &out)
const {
309 get_value().output(out);
317 INLINE
void ConfigVariableSearchPath::
318 write(ostream &out)
const {
319 get_value().write(out);
324 variable.output(out);
const Filename & get_directory(int n) const
Returns the nth directory on the search list.
This is similar to a ConfigVariableList, but it returns its list as a DSearchPath, as a list of directories.
The internal definition of a ConfigVariable.
bool is_empty() const
Returns true if the search list is empty, false otherwise.
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. ...
void clear()
Removes all the directories from the search list.
bool clear_local_value()
Removes all the directories locally added to the search list, and restores it to its original form...
void append_directory(const Filename &directory)
Adds a new directory 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...
int find_all_files(const Filename &filename, DSearchPath::Results &results) const
Searches all the directories in the search list for the indicated file, in order. ...
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.
void append_path(const string &path, const string &separator=string())
Adds all of the directories listed in the search path to the end of the search list.
void append_path(const string &path, const string &separator=string())
Adds all of the directories listed in the search path to the end of the search list.
The name of a file, such as a texture file or an Egg file.
int get_num_directories() const
Returns the number of directories on the search list.
void clear()
Removes all the directories locally added to the search list, and restores it to its original form...
Filename find_file(const Filename &filename) const
Searches all the directories in the search list for the indicated file, in order. ...
This class stores a list of directories that can be searched, in order, to locate a particular file...
void prepend_path(const DSearchPath &path)
Adds all of the directories listed in the search path to the beginning of the search list...
void prepend_directory(const Filename &directory)
Adds a new directory to the front of the search list.
This class is the base class for both ConfigVariableList and ConfigVariable (and hence for all of the...
void append_directory(const Filename &directory)
Adds a new directory to the end of the search list.
A single declaration of a config variable, typically defined as one line in a .prc file...
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 prepend_directory(const Filename &directory)
Adds a new directory to the front of the search list.