Panda3D
 All Classes Functions Variables Enumerations
Classes | Public Member Functions | Static Public Member Functions | List of all members
ConfigPageManager Class Reference

A global object that maintains the set of ConfigPages everywhere in the world, and keeps them in sorted order. More...

#include "configPageManager.h"

Inheritance diagram for ConfigPageManager:
ConfigFlags

Public Member Functions

bool delete_explicit_page (ConfigPage *page)
 Removes a previously-constructed ConfigPage from the set of active pages, and deletes it. More...
 
ConfigPageget_explicit_page (int n) const
 Returns the nth explicit ConfigPage in the world. More...
 
ConfigPageget_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...
 
DSearchPathget_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...
 
ConfigPagemake_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 ConfigPageManagerget_global_ptr ()
 

Additional Inherited Members

- Public Types inherited from ConfigFlags
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
}
 

Detailed Description

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.

Member Function Documentation

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.

ConfigPage * ConfigPageManager::get_explicit_page ( int  n) const
inline

Returns the nth explicit ConfigPage in the world.

See get_num_explicit_pages().

Definition at line 185 of file configPageManager.I.

ConfigPage * ConfigPageManager::get_implicit_page ( int  n) const
inline

Returns the nth implicit ConfigPage in the world.

See get_num_implicit_pages().

Definition at line 159 of file configPageManager.I.

int ConfigPageManager::get_num_explicit_pages ( ) const
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.

int ConfigPageManager::get_num_implicit_pages ( ) const
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.

int ConfigPageManager::get_num_prc_encrypted_patterns ( ) const
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.

int ConfigPageManager::get_num_prc_executable_patterns ( ) const
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.

int ConfigPageManager::get_num_prc_patterns ( ) const
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.

string ConfigPageManager::get_prc_encrypted_pattern ( int  n) const
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.

string ConfigPageManager::get_prc_executable_pattern ( int  n) const
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.

string ConfigPageManager::get_prc_pattern ( int  n) const
inline

Returns the nth filename pattern that will be considered a match as a valid config file.

See get_num_prc_patterns().

Definition at line 82 of file configPageManager.I.

DSearchPath & ConfigPageManager::get_search_path ( )
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 load_implicit_pages().

void ConfigPageManager::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 reload_implicit_pages().

Referenced by get_search_path().

bool ConfigPageManager::loaded_implicit_pages ( ) const
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.

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.

void ConfigPageManager::mark_unsorted ( )
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 ConfigPage::set_sort().

void ConfigPageManager::reload_implicit_pages ( )

The documentation for this class was generated from the following files: