ConfigDeclaration
from panda3d.core import ConfigDeclaration
- class ConfigDeclaration
Bases:
Bases:
ConfigFlags
A single declaration of a config variable, typically defined as one line in a .prc file, e.g. “show-frame-rate-meter 1”. This is really just a pairing of a string name (actually, a
ConfigVariableCore
pointer) to a string value.Inheritance diagram
- get_bool_word(n: int) bool
Returns the boolean value of the nth word of the declaration’s value, or false if there is no nth value. See also
has_bool_word()
.
- get_decl_seq() int
Returns the sequence number of the declaration within the page. Sequence numbers are assigned as each declaration is created; each declaration is given a higher sequence number than all the declarations created in the page before it.
- get_double_word(n: int) float
Returns the integer value of the nth word of the declaration’s value, or 0 if there is no nth value. See also
has_double_word()
.
- get_filename_value() Filename
Interprets the string value as a filename and returns it, with any variables expanded.
- get_int64_word(n: int) int
Returns the int64 value of the nth word of the declaration’s value, or 0 if there is no nth value. See also
has_int64_word()
.
- get_int_word(n: int) int
Returns the integer value of the nth word of the declaration’s value, or 0 if there is no nth value. See also
has_int_word()
.
- get_num_words() int
Returns the number of words in the declaration’s value. A word is defined as a sequence of non-whitespace characters delimited by whitespace.
- get_page() ConfigPage
Returns the page on which this declaration can be found.
- get_string_value() str
Returns the value assigned to this variable. This is the original one-line text defined for the variable in the .prc file (or passed to
ConfigPage.make_declaration()
).
- get_string_word(n: int) str
Returns the string value of the nth word of the declaration’s value, or empty string if there is no nth value. See also
has_string_word()
.
- get_variable() ConfigVariableCore
Returns the variable that this declaration names. This variable may or may not have been defined by the time the declaration is read.
- has_bool_word(n: int) bool
Returns true if the declaration’s value has a valid boolean value for the nth word.
- has_double_word(n: int) bool
Returns true if the declaration’s value has a valid integer value for the nth word.
- has_int64_word(n: int) bool
Returns true if the declaration’s value has a valid int64 value for the nth word.
- has_int_word(n: int) bool
Returns true if the declaration’s value has a valid integer value for the nth word.
- has_string_word(n: int) bool
Returns true if the declaration’s value has a valid string value for the nth word. This is really the same thing as asking if there are at least n words in the value.
- property page ConfigPage
Returns the page on which this declaration can be found.
- set_bool_word(n: int, value: bool)
Changes the nth word to the indicated value without affecting the other words.
- set_double_word(n: int, value: float)
Changes the nth word to the indicated value without affecting the other words.
- set_int64_word(n: int, value: int)
Changes the nth word to the indicated value without affecting the other words.
- set_int_word(n: int, value: int)
Changes the nth word to the indicated value without affecting the other words.
- set_string_word(n: int, value: str)
Changes the nth word to the indicated value without affecting the other words.
- property variable ConfigVariableCore
Returns the variable that this declaration names. This variable may or may not have been defined by the time the declaration is read.