30class EXPCL_DTOOL_PRC ConfigPage {
32 ConfigPage(
const std::string &name,
bool implicit_load,
int page_seq);
36 INLINE
bool operator < (
const ConfigPage &other)
const;
42 INLINE
const std::string &
get_name()
const;
79 void output(std::ostream &out)
const;
81 void write(std::ostream &out)
const;
84 INLINE
void make_dirty();
85 void read_prc_line(
const std::string &line);
86 static unsigned int hex_digit(
unsigned char digit);
95 typedef std::vector<ConfigDeclaration *> Declarations;
96 Declarations _declarations;
98 std::string _signature;
106 static ConfigPage *_default_page;
107 static ConfigPage *_local_page;
109 friend class ConfigPageManager;
112INLINE std::ostream &operator << (std::ostream &out,
const ConfigPage &page);
A single declaration of a config variable, typically defined as one line in a .prc file,...
A page of ConfigDeclarations that may be loaded or unloaded.
std::string get_string_value(size_t n) const
Returns the value assigned by the nth declaration on the page.
bool delete_declaration(ConfigDeclaration *decl)
Removes the indicated declaration from the page and deletes it.
get_sort
Returns the explicit sort order of this particular ConfigPage.
const ConfigDeclaration * get_declaration(size_t n) const
Returns the nth declaration on the page.
ConfigDeclaration * make_declaration(const std::string &variable, const std::string &value)
Adds the indicated variable/value pair as a new declaration on the page.
get_signature
Returns the raw binary signature that was found in the prc file, if any.
get_num_declarations
Returns the number of declarations on the page.
bool read_encrypted_prc(std::istream &in, const std::string &password)
Automatically decrypts and reads the stream, given the indicated password.
modify_declaration
Returns a modifiable pointer to the nth declaration on the page.
set_trust_level
Explicitly sets the trust level on this particular page.
std::string get_variable_name(size_t n) const
Returns the variable named by the nth declaration on the page.
static ConfigPage * get_default_page()
Returns a pointer to the global "default page".
get_page_seq
Returns the sequence number of the page.
static ConfigPage * get_local_page()
Returns a pointer to the global "local page".
is_implicit
Returns true if the page was loaded by implicitly searching the config path on startup,...
is_special
Returns true if this is the special "default" or "local" page, or false if it is an ordinary page,...
get_trust_level
Returns the trust level associated with this page.
bool read_prc(std::istream &in)
Reads the contents of a complete prc file, as returned by the indicated istream, into the current pag...
set_sort
Changes the explicit sort order of this particular ConfigPage.
void output_brief_signature(std::ostream &out) const
Outputs the first few hex digits of the signature.
void clear()
Removes all of the declarations from the page.
bool is_variable_used(size_t n) const
Returns true if the nth active variable on the page has been used by code, false otherwise.
get_name
Returns the name of the page.
The internal definition of a ConfigVariable.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.