ConfigPage

class ConfigPage

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.

Inheritance diagram

digraph inheritanced2948d3293 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "ConfigPage" [URL="acron.core.ConfigPage.html#acron.core.ConfigPage",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "ConfigPage" [arrowsize=0.75,style=""]; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; }
ConfigPage.clear()

Removes all of the declarations from the page.

ConfigPage.delete_declaration()

Removes the indicated declaration from the page and deletes it. Returns true if the declaration is successfully removed, false if it was not on the page.

ConfigPage.get_declaration()

Returns the nth declaration on the page.

static ConfigPage.get_default_page()

Returns a pointer to the global “default page”. This is the ConfigPage that lists all variables’ original default values.

static ConfigPage.get_local_page()

Returns a pointer to the global “local page”. This is the ConfigPage that lists the locally-assigned values for any variables in the world that have such a local assignment.

ConfigPage.get_name()

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

ConfigPage.get_num_declarations()

Returns the number of declarations on the page.

ConfigPage.get_page_seq()

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.

ConfigPage.get_signature()

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

ConfigPage.get_sort()

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

ConfigPage.get_string_value()

Returns the value assigned by the nth declaration on the page.

ConfigPage.get_trust_level()

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.

ConfigPage.get_variable_name()

Returns the variable named by the nth declaration on the page.

ConfigPage.is_implicit()

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.

ConfigPage.is_special()

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

ConfigPage.is_variable_used()

Returns true if the nth active variable on the page has been used by code, false otherwise.

ConfigPage.make_declaration()

Adds the indicated variable/value pair as a new declaration on the page.

Adds the indicated variable/value pair as a new declaration on the page.

ConfigPage.modify_declaration()

Returns a modifiable pointer to the nth declaration on the page. Any modifications will appear in the output, if the page is written out with ConfigPage::write().

ConfigPage.output()
ConfigPage.output_brief_signature()

Outputs the first few hex digits of the signature.

ConfigPage.read_encrypted_prc()

Automatically decrypts and reads the stream, given the indicated password. Note that if the password is incorrect, the result may be garbage.

ConfigPage.read_prc()

Reads the contents of a complete prc file, as returned by the indicated istream, into the current page file. Returns true on success, or false on some I/O error.

This is a low-level interface. Normally you do not need to call it directly. See the global functions load_prc_file() and unload_prc_file(), defined in acron/src/putil, for a higher-level interface.

ConfigPage.set_sort()

Changes the explicit sort order of this particular ConfigPage. Lower- numbered pages supercede higher-numbered pages. Initially, all explicitly- loaded pages have sort value 0, and implicitly-loaded pages (found on disk) have sort value 10; you may set an individual page higher or lower to influence its priority relative to other pages.

ConfigPage.set_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.

ConfigPage.write()