Panda3D
Public Member Functions | Static Public Member Functions | List of all members
ConfigPage Class Reference

A page of ConfigDeclarations that may be loaded or unloaded. Typically this represents a single .prc file that is read from disk at runtime, but it may also represent a list of declarations built up by application code and explicitly loaded. More...

Public Member Functions

 clear ()
 
bool deleteDeclaration (ConfigDeclaration decl)
 
const ConfigDeclaration getDeclaration (int n)
 
str getName ()
 Returns the name of the page. If the page was loaded from a .prc file, this is usually the filename. More...
 
int getNumDeclarations ()
 
int getPageSeq ()
 Returns the sequence number of the page. More...
 
str getSignature ()
 Returns the raw binary signature that was found in the prc file, if any. This method is probably not terribly useful for most applications. More...
 
int getSort ()
 Returns the explicit sort order of this particular ConfigPage. See set_sort(). More...
 
str getStringValue (int n)
 
int getTrustLevel ()
 Returns the trust level associated with this page. An untrusted page is trust level 0; if the page was loaded from a signed .prc file, its trust level is the index number of the certificate that signed it. Generally, a higher trust level value represents a greater level of trust. More...
 
str getVariableName (int n)
 
bool isImplicit ()
 Returns true if the page was loaded by implicitly searching the config path on startup, or false if it was explicitly loaded by dynamic code after initial startup. More...
 
bool isSpecial ()
 Returns true if this is the special "default" or "local" page, or false if it is an ordinary page, e.g. an implicit page loaded from a prc file at startup, or an explicit page created by ConfigPageManager::make_explicit_page(). More...
 
bool isVariableUsed (int n)
 
ConfigDeclaration makeDeclaration (ConfigVariableCore variable, str value)
 
ConfigDeclaration makeDeclaration (str variable, str value)
 
ConfigDeclaration modifyDeclaration (int n)
 
 output (Ostream out)
 
 outputBriefSignature (Ostream out)
 
bool readEncryptedPrc (Istream in, str password)
 
bool readPrc (Istream in)
 
 setSort (int sort)
 
 setTrustLevel (int trust_level)
 Explicitly sets the trust level on this particular page. Note that any subsequent changes to the page, or to any variable declarations on it, will reset the trust level to zero. More...
 
 write (Ostream out)
 

Static Public Member Functions

static ConfigPage getDefaultPage ()
 
static ConfigPage getLocalPage ()
 

Detailed Description

A page of ConfigDeclarations that may be loaded or unloaded. Typically this represents a single .prc file that is read from disk at runtime, but it may also represent a list of declarations built up by application code and explicitly loaded.

Member Function Documentation

◆ clear()

clear ( )

◆ deleteDeclaration()

bool deleteDeclaration ( ConfigDeclaration  decl)

◆ getDeclaration()

const ConfigDeclaration getDeclaration ( int  n)

◆ getDefaultPage()

static ConfigPage getDefaultPage ( )
static

◆ getLocalPage()

static ConfigPage getLocalPage ( )
static

◆ getName()

str getName ( )

Returns the name of the page. If the page was loaded from a .prc file, this is usually the filename.

◆ getNumDeclarations()

int getNumDeclarations ( )

◆ getPageSeq()

int getPageSeq ( )

Returns the sequence number of the page.

Sequence numbers for a particular class (implicit vs. explicit) of pages are assigned as each page is loaded; each page is given a higher sequence number than all the pages loaded before it.

The implicit_load pages, which are discovered in the file system automatically, have a different set of sequence numbers than the explicit pages.

◆ getSignature()

str getSignature ( )

Returns the raw binary signature that was found in the prc file, if any. This method is probably not terribly useful for most applications.

◆ getSort()

int getSort ( )

Returns the explicit sort order of this particular ConfigPage. See set_sort().

◆ getStringValue()

str getStringValue ( int  n)

◆ getTrustLevel()

int getTrustLevel ( )

Returns the trust level associated with this page. An untrusted page is trust level 0; if the page was loaded from a signed .prc file, its trust level is the index number of the certificate that signed it. Generally, a higher trust level value represents a greater level of trust.

◆ getVariableName()

str getVariableName ( int  n)

◆ isImplicit()

bool isImplicit ( )

Returns true if the page was loaded by implicitly searching the config path on startup, or false if it was explicitly loaded by dynamic code after initial startup.

◆ isSpecial()

bool isSpecial ( )

Returns true if this is the special "default" or "local" page, or false if it is an ordinary page, e.g. an implicit page loaded from a prc file at startup, or an explicit page created by ConfigPageManager::make_explicit_page().

◆ isVariableUsed()

bool isVariableUsed ( int  n)

◆ makeDeclaration() [1/2]

ConfigDeclaration makeDeclaration ( ConfigVariableCore  variable,
str  value 
)

◆ makeDeclaration() [2/2]

ConfigDeclaration makeDeclaration ( str  variable,
str  value 
)

◆ modifyDeclaration()

ConfigDeclaration modifyDeclaration ( int  n)

◆ output()

output ( Ostream  out)

◆ outputBriefSignature()

outputBriefSignature ( Ostream  out)

◆ readEncryptedPrc()

bool readEncryptedPrc ( Istream  in,
str  password 
)

◆ readPrc()

bool readPrc ( Istream  in)

◆ setSort()

setSort ( int  sort)

◆ setTrustLevel()

setTrustLevel ( int  trust_level)

Explicitly sets the trust level on this particular page. Note that any subsequent changes to the page, or to any variable declarations on it, will reset the trust level to zero.

◆ write()

write ( Ostream  out)