Panda3D
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...

Inheritance diagram for ConfigPageManager:
ConfigFlags

Public Member Functions

bool deleteExplicitPage (ConfigPage page)
 Removes a previously-constructed ConfigPage from the set of active pages, and deletes it. More...
 
ConfigPage getExplicitPage (int n)
 Returns the nth explicit ConfigPage in the world. More...
 
ConfigPage getImplicitPage (int n)
 Returns the nth implicit ConfigPage in the world. More...
 
int getNumExplicitPages ()
 Returns the current number of explicitly-loaded ConfigPages in the world. More...
 
int getNumImplicitPages ()
 Returns the current number of implicitly-loaded ConfigPages in the world. More...
 
int getNumPrcEncryptedPatterns ()
 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 getNumPrcExecutablePatterns ()
 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 getNumPrcPatterns ()
 Returns the number of patterns, like "*.prc", that are compiled in that will be searched for as default config filenames. More...
 
str getPrcEncryptedPattern (int n)
 Returns the nth filename pattern that will be considered a match as a valid encrypted config file. More...
 
str getPrcExecutablePattern (int n)
 Returns the nth filename pattern that will be considered a match as a valid executable-style config file. More...
 
str getPrcPattern (int n)
 Returns the nth filename pattern that will be considered a match as a valid config file. More...
 
DSearchPath getSearchPath ()
 Returns the search path used to locate implicit .prc files. More...
 
bool loadedImplicitPages ()
 Returns true if the implicit *.prc files have already been loaded, false otherwise. More...
 
 loadImplicitPages ()
 Searches the PRC_DIR and/or PRC_PATH directories for *.prc files and loads them in as pages. More...
 
ConfigPage makeExplicitPage (str name)
 Creates and returns a new, empty ConfigPage. More...
 
 output (Ostream out)
 
 reloadImplicitPages ()
 Searches the PRC_DIR and/or PRC_PATH directories for *.prc files and loads them in as pages. More...
 
 write (Ostream out)
 
- Public Member Functions inherited from ConfigFlags
 __init__ ()
 
 __init__ (const ConfigFlags)
 

Static Public Member Functions

static ConfigPageManager getGlobalPtr ()
 

Additional Inherited Members

- Public Types inherited from ConfigFlags
enum  ValueType {
  VT_undefined = 0, VT_list = 1, VT_string = 2, VT_filename = 3,
  VT_bool = 4, VT_int = 5, VT_double = 6, VT_enum = 7,
  VT_search_path = 8, VT_int64 = 9, VT_color = 10
}
 
enum  VariableFlags {
  F_trust_level_mask = 4095, F_open = 4096, F_closed = 8192, F_dynamic = 16384,
  F_dconfig = 32768
}
 

Detailed Description

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

Member Function Documentation

◆ deleteExplicitPage()

bool deleteExplicitPage ( 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).

◆ getExplicitPage()

ConfigPage getExplicitPage ( int  n)

Returns the nth explicit ConfigPage in the world.

See get_num_explicit_pages().

◆ getGlobalPtr()

static ConfigPageManager getGlobalPtr ( )
static

◆ getImplicitPage()

ConfigPage getImplicitPage ( int  n)

Returns the nth implicit ConfigPage in the world.

See get_num_implicit_pages().

◆ getNumExplicitPages()

int getNumExplicitPages ( )

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().

◆ getNumImplicitPages()

int getNumImplicitPages ( )

Returns the current number of implicitly-loaded ConfigPages in the world.

These represent files that were automatically discovered on the disk as .prc files.

◆ getNumPrcEncryptedPatterns()

int getNumPrcEncryptedPatterns ( )

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.

◆ getNumPrcExecutablePatterns()

int getNumPrcExecutablePatterns ( )

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.

◆ getNumPrcPatterns()

int getNumPrcPatterns ( )

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.

◆ getPrcEncryptedPattern()

str getPrcEncryptedPattern ( int  n)

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

See get_num_prc_encrypted_patterns().

◆ getPrcExecutablePattern()

str getPrcExecutablePattern ( int  n)

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

See get_num_prc_executable_patterns().

◆ getPrcPattern()

str getPrcPattern ( int  n)

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

See get_num_prc_patterns().

◆ getSearchPath()

DSearchPath getSearchPath ( )

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.

◆ loadedImplicitPages()

bool loadedImplicitPages ( )

Returns true if the implicit *.prc files have already been loaded, false otherwise.

Normally this will only be false briefly before startup.

◆ loadImplicitPages()

loadImplicitPages ( )

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().

◆ makeExplicitPage()

ConfigPage makeExplicitPage ( str  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.

◆ output()

output ( Ostream  out)

◆ reloadImplicitPages()

reloadImplicitPages ( )

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.

◆ write()

write ( Ostream  out)