Panda3D
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 (size_t n) const
 Returns the nth explicit ConfigPage in the world. More...
 
ConfigPageget_implicit_page (size_t n) const
 Returns the nth implicit ConfigPage in the world. More...
 
size_t get_num_explicit_pages () const
 Returns the current number of explicitly-loaded ConfigPages in the world. More...
 
size_t get_num_implicit_pages () const
 Returns the current number of implicitly-loaded ConfigPages in the world. More...
 
size_t 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...
 
size_t 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...
 
size_t 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...
 
std::string get_prc_encrypted_pattern (size_t n) const
 Returns the nth filename pattern that will be considered a match as a valid encrypted config file. More...
 
std::string get_prc_executable_pattern (size_t n) const
 Returns the nth filename pattern that will be considered a match as a valid executable-style config file. More...
 
std::string get_prc_pattern (size_t 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 std::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 (std::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 (std::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 31 of file configPageManager.h.

Member Function Documentation

◆ delete_explicit_page()

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 527 of file configPageManager.cxx.

Referenced by unload_prc_file().

◆ get_explicit_page()

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

Returns the nth explicit ConfigPage in the world.

See get_num_explicit_pages().

Definition at line 145 of file configPageManager.I.

◆ get_implicit_page()

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

Returns the nth implicit ConfigPage in the world.

See get_num_implicit_pages().

Definition at line 124 of file configPageManager.I.

◆ get_num_explicit_pages()

size_t 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 136 of file configPageManager.I.

◆ get_num_implicit_pages()

size_t 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 115 of file configPageManager.I.

◆ get_num_prc_encrypted_patterns()

size_t 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 75 of file configPageManager.I.

◆ get_num_prc_executable_patterns()

size_t 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 95 of file configPageManager.I.

◆ get_num_prc_patterns()

size_t 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 55 of file configPageManager.I.

◆ get_prc_encrypted_pattern()

std::string ConfigPageManager::get_prc_encrypted_pattern ( size_t  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 84 of file configPageManager.I.

◆ get_prc_executable_pattern()

std::string ConfigPageManager::get_prc_executable_pattern ( size_t  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 104 of file configPageManager.I.

◆ get_prc_pattern()

std::string ConfigPageManager::get_prc_pattern ( size_t  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 64 of file configPageManager.I.

◆ get_search_path()

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 43 of file configPageManager.I.

References load_implicit_pages().

◆ 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 30 of file configPageManager.I.

References reload_implicit_pages().

Referenced by get_search_path().

◆ loaded_implicit_pages()

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 19 of file configPageManager.I.

◆ make_explicit_page()

ConfigPage * ConfigPageManager::make_explicit_page ( const std::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 510 of file configPageManager.cxx.

◆ mark_unsorted()

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 158 of file configPageManager.I.

◆ reload_implicit_pages()

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 85 of file configPageManager.cxx.

Referenced by load_implicit_pages().


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