Panda3D
|
A global object that maintains the set of ConfigPages everywhere in the world, and keeps them in sorted order. More...
#include "configPageManager.h"
Public Member Functions | |
bool | delete_explicit_page (ConfigPage *page) |
Removes a previously-constructed ConfigPage from the set of active pages, and deletes it. More... | |
ConfigPage * | get_explicit_page (int n) const |
Returns the nth explicit ConfigPage in the world. More... | |
ConfigPage * | get_implicit_page (int n) const |
Returns the nth implicit ConfigPage in the world. More... | |
int | get_num_explicit_pages () const |
Returns the current number of explicitly-loaded ConfigPages in the world. More... | |
int | get_num_implicit_pages () const |
Returns the current number of implicitly-loaded ConfigPages in the world. More... | |
int | get_num_prc_encrypted_patterns () const |
Returns the number of patterns, like "*.pre", that are compiled in that will be searched for as special config files that are understood to be encrypted. More... | |
int | get_num_prc_executable_patterns () const |
Returns the number of patterns, like "*.exe", that are compiled in that will be searched for as special config files that are to be executed as a program, and their output taken to be input. More... | |
int | get_num_prc_patterns () const |
Returns the number of patterns, like "*.prc", that are compiled in that will be searched for as default config filenames. More... | |
string | get_prc_encrypted_pattern (int n) const |
Returns the nth filename pattern that will be considered a match as a valid encrypted config file. More... | |
string | get_prc_executable_pattern (int n) const |
Returns the nth filename pattern that will be considered a match as a valid executable-style config file. More... | |
string | get_prc_pattern (int n) const |
Returns the nth filename pattern that will be considered a match as a valid config file. More... | |
DSearchPath & | get_search_path () |
Returns the search path used to locate implicit .prc files. More... | |
void | load_implicit_pages () |
Searches the PRC_DIR and/or PRC_PATH directories for .prc files and loads them in as pages. More... | |
bool | loaded_implicit_pages () const |
Returns true if the implicit *.prc files have already been loaded, false otherwise. More... | |
ConfigPage * | make_explicit_page (const string &name) |
Creates and returns a new, empty ConfigPage. More... | |
void | mark_unsorted () |
This method is meant to be used internally to this module; there is no need to call it directly. More... | |
void | output (ostream &out) const |
void | reload_implicit_pages () |
Searches the PRC_DIR and/or PRC_PATH directories for .prc files and loads them in as pages. More... | |
void | write (ostream &out) const |
Static Public Member Functions | |
static ConfigPageManager * | get_global_ptr () |
Additional Inherited Members | |
![]() | |
enum | ValueType { VT_undefined, VT_list, VT_string, VT_filename, VT_bool, VT_int, VT_double, VT_enum, VT_search_path, VT_int64, VT_color } |
enum | VariableFlags { F_trust_level_mask = 0x00000fff, F_open = 0x00001000, F_closed = 0x00002000, F_dynamic = 0x00004000, F_dconfig = 0x00008000 } |
A global object that maintains the set of ConfigPages everywhere in the world, and keeps them in sorted order.
Definition at line 34 of file configPageManager.h.
bool ConfigPageManager::delete_explicit_page | ( | ConfigPage * | page | ) |
Removes a previously-constructed ConfigPage from the set of active pages, and deletes it.
The ConfigPage object is no longer valid after this call. Returns true if the page is successfully deleted, or false if it was unknown (which should never happen if the page was legitimately constructed).
Definition at line 449 of file configPageManager.cxx.
References ConfigPage::get_name(), ConfigPage::get_signature(), ConfigPage::get_trust_level(), and ConfigPage::output_brief_signature().
Referenced by make_explicit_page().
|
inline |
Returns the nth explicit ConfigPage in the world.
Definition at line 185 of file configPageManager.I.
References mark_unsorted().
Referenced by get_num_explicit_pages().
|
inline |
Returns the nth implicit ConfigPage in the world.
Definition at line 159 of file configPageManager.I.
References get_num_explicit_pages().
Referenced by get_num_implicit_pages().
|
inline |
Returns the current number of explicitly-loaded ConfigPages in the world.
These represent pages that were loaded dynamically at runtime by explicit calls to ConfigPageManager::make_explicit_page().
Definition at line 174 of file configPageManager.I.
References get_explicit_page().
Referenced by get_implicit_page().
|
inline |
Returns the current number of implicitly-loaded ConfigPages in the world.
These represent files that were automatically discovered on the disk as .prc files.
Definition at line 148 of file configPageManager.I.
References get_implicit_page().
Referenced by get_prc_executable_pattern().
|
inline |
Returns the number of patterns, like "*.pre", that are compiled in that will be searched for as special config files that are understood to be encrypted.
Definition at line 95 of file configPageManager.I.
References get_prc_encrypted_pattern().
Referenced by get_prc_pattern().
|
inline |
Returns the number of patterns, like "*.exe", that are compiled in that will be searched for as special config files that are to be executed as a program, and their output taken to be input.
This is normally empty.
Definition at line 122 of file configPageManager.I.
References get_prc_executable_pattern().
Referenced by get_prc_encrypted_pattern().
|
inline |
Returns the number of patterns, like "*.prc", that are compiled in that will be searched for as default config filenames.
Normally there is only one pattern, and it is "*.prc", but others may be specified with the PRC_FILENAME variable in Config.pp.
Definition at line 70 of file configPageManager.I.
References get_prc_pattern().
Referenced by get_search_path().
|
inline |
Returns the nth filename pattern that will be considered a match as a valid encrypted config file.
See get_num_prc_encrypted_patterns().
Definition at line 107 of file configPageManager.I.
References get_num_prc_executable_patterns().
Referenced by get_num_prc_encrypted_patterns().
|
inline |
Returns the nth filename pattern that will be considered a match as a valid executable-style config file.
See get_num_prc_executable_patterns().
Definition at line 134 of file configPageManager.I.
References get_num_implicit_pages().
Referenced by get_num_prc_executable_patterns().
|
inline |
Returns the nth filename pattern that will be considered a match as a valid config file.
Definition at line 82 of file configPageManager.I.
References get_num_prc_encrypted_patterns().
Referenced by get_num_prc_patterns().
|
inline |
Returns the search path used to locate implicit .prc files.
This is determined by the PRC_DIR and PRC_PATH environment variables. The object returned by this method may be modified to change the path at runtime, and then reload_implicit_pages() called.
Definition at line 54 of file configPageManager.I.
References get_num_prc_patterns(), and load_implicit_pages().
Referenced by load_implicit_pages().
|
inline |
Searches the PRC_DIR and/or PRC_PATH directories for .prc files and loads them in as pages.
This is normally called automatically at startup time, when the first variable's value is referenced. See also reload_implicit_pages().
Definition at line 38 of file configPageManager.I.
References get_search_path(), and reload_implicit_pages().
Referenced by get_search_path(), ConfigVariableCore::get_unique_reference(), and loaded_implicit_pages().
|
inline |
Returns true if the implicit *.prc files have already been loaded, false otherwise.
Normally this will only be false briefly before startup.
Definition at line 24 of file configPageManager.I.
References load_implicit_pages().
ConfigPage * ConfigPageManager::make_explicit_page | ( | const string & | name | ) |
Creates and returns a new, empty ConfigPage.
This page will be stacked on top of any pages that were created before; it may shadow variable declarations that are defined in previous pages.
Definition at line 429 of file configPageManager.cxx.
References delete_explicit_page().
Referenced by reload_implicit_pages().
|
inline |
This method is meant to be used internally to this module; there is no need to call it directly.
It indicates that the sort values of some pages may have changed and pages need to be re-sorted.
Definition at line 201 of file configPageManager.I.
Referenced by get_explicit_page(), and ConfigPage::set_sort().
void ConfigPageManager::reload_implicit_pages | ( | ) |
Searches the PRC_DIR and/or PRC_PATH directories for .prc files and loads them in as pages.
This may be called after startup, to force the system to re-read all of the implicit prc files.
Definition at line 87 of file configPageManager.cxx.
References DSearchPath::append_directory(), DSearchPath::clear(), ConfigDeclaration::extract_words(), Filename::from_os_specific(), DSearchPath::get_directory(), ExecutionEnvironment::get_environment_variable(), DSearchPath::get_num_directories(), Filename::is_directory(), DSearchPath::is_empty(), Filename::is_executable(), Filename::make_canonical(), make_explicit_page(), Filename::make_true_case(), Filename::open_read(), ConfigPage::read_encrypted_prc(), ConfigPage::read_prc(), Filename::scan_directory(), Filename::set_binary(), GlobPattern::set_case_sensitive(), Filename::set_text(), and Filename::to_os_specific().
Referenced by load_implicit_pages().