Panda3D
|
This is a generic, untyped ConfigVariable. More...
#include "configVariable.h"
Public Member Functions | |
ConfigVariable (const string &name) | |
Use this constructor to make a ConfigVariable of an unspecified type. More... | |
void | clear_value () |
Removes the value assigned to this variable, and lets its original value (as read from the prc files) show through. More... | |
bool | get_bool_word (int n) const |
Returns the boolean value of the nth word of the variable's value, or false if there is no nth value. More... | |
const ConfigDeclaration * | get_default_value () const |
Returns the default variable specified for this variable. More... | |
double | get_double_word (int n) const |
Returns the integer value of the nth word of the variable's value, or 0 if there is no nth value. More... | |
PN_int64 | get_int64_word (int n) const |
Returns the int64 value of the nth word of the variable's value, or 0 if there is no nth value. More... | |
int | get_int_word (int n) const |
Returns the integer value of the nth word of the variable's value, or 0 if there is no nth value. More... | |
int | get_num_words () const |
Returns the number of words in the variable's value. More... | |
const string & | get_string_value () const |
Returns the toplevel value of the variable, formatted as a string. More... | |
string | get_string_word (int n) const |
Returns the string value of the nth word of the variable's value, or empty string if there is no nth value. More... | |
bool | has_bool_word (int n) const |
Returns true if the variable's value has a valid boolean value for the nth word. More... | |
bool | has_double_word (int n) const |
Returns true if the variable's value has a valid integer value for the nth word. More... | |
bool | has_int64_word (int n) const |
Returns true if the variable's value has a valid 64-bit integer value for the nth word. More... | |
bool | has_int_word (int n) const |
Returns true if the variable's value has a valid integer value for the nth word. More... | |
bool | has_string_word (int n) const |
Returns true if the variable's value has a valid string value for the nth word. More... | |
void | set_bool_word (int n, bool value) |
Changes the nth word to the indicated value without affecting the other words. More... | |
void | set_double_word (int n, double value) |
Changes the nth word to the indicated value without affecting the other words. More... | |
void | set_int64_word (int n, PN_int64 value) |
Changes the nth word to the indicated value without affecting the other words. More... | |
void | set_int_word (int n, int value) |
Changes the nth word to the indicated value without affecting the other words. More... | |
void | set_string_value (const string &value) |
Changes the value assigned to this variable. More... | |
void | set_string_word (int n, const string &value) |
Changes the nth word to the indicated value without affecting the other words. More... | |
![]() | |
bool | clear_local_value () |
Removes the local value defined for this variable, and allows its value to be once again retrieved from the .prc files. More... | |
const string & | get_description () const |
Returns the brief description of this variable, if it has been defined. More... | |
int | get_flags () const |
Returns the flags value as set by set_flags(). More... | |
const string & | get_name () const |
Returns the name of the variable. More... | |
int | get_trust_level () const |
Returns the minimum trust_level a prc file must demonstrate in order to redefine the value for this variable. More... | |
ValueType | get_value_type () const |
Returns the stated type of this variable. More... | |
bool | has_local_value () const |
Returns true if this variable's value has been shadowed by a local assignment (as created via make_local_value()), or false otherwise. More... | |
bool | has_value () const |
Returns true if this variable has an explicit value, either from a prc file or locally set, or false if variable has its default value. More... | |
bool | is_closed () const |
Returns true if the variable is not trusted by any prc file (and hence cannot be modified from its compiled-in default value), or false for the normal case, in which the variable can be modified by any prc file at or above its trust level (see get_trust_level()). More... | |
bool | is_dynamic () const |
Returns true if the variable was indicated as "dynamic" by its constructor, indicating that its name was dynamically generated, possibly from a large pool, and it should not be listed along with the other variables. More... | |
void | output (ostream &out) const |
void | write (ostream &out) const |
Additional Inherited Members | |
![]() | |
enum | ValueType { VT_undefined, VT_list, VT_string, VT_filename, VT_bool, VT_int, VT_double, VT_enum, VT_search_path, VT_int64, VT_color } |
enum | VariableFlags { F_trust_level_mask = 0x00000fff, F_open = 0x00001000, F_closed = 0x00002000, F_dynamic = 0x00004000, F_dconfig = 0x00008000 } |
This is a generic, untyped ConfigVariable.
It is also the base class for the typed ConfigVariables, and contains all of the code common to ConfigVariables of all types (except ConfigVariableList, which is a bit of a special case).
Mostly, this class serves as a thin wrapper around ConfigVariableCore and/or ConfigDeclaration, more or less duplicating the interface presented there.
Definition at line 35 of file configVariable.h.
|
inline |
Use this constructor to make a ConfigVariable of an unspecified type.
Usually you'd want to do this just to reference a previously-defined ConfigVariable of a specific type, without having to know what type it is.
Definition at line 50 of file configVariable.I.
References get_default_value().
|
inline |
Removes the value assigned to this variable, and lets its original value (as read from the prc files) show through.
Definition at line 113 of file configVariable.I.
References get_num_words().
Referenced by set_string_value().
|
inline |
Returns the boolean value of the nth word of the variable's value, or false if there is no nth value.
See also has_bool_word().
Definition at line 221 of file configVariable.I.
References ConfigDeclaration::get_bool_word(), and get_int_word().
Referenced by get_string_word(), ConfigVariableBool::get_value(), and ConfigVariableBool::get_word().
|
inline |
Returns the default variable specified for this variable.
If the variable has not yet been defined, this will return NULL.
Definition at line 73 of file configVariable.I.
References get_string_value().
Referenced by ConfigVariable(), ConfigVariableBool::get_default_value(), ConfigVariableDouble::get_default_value(), ConfigVariableInt::get_default_value(), ConfigVariableInt64::get_default_value(), ConfigVariableString::get_default_value(), ConfigVariableEnum< NotifySeverity >::get_default_value(), ConfigVariableColor::get_default_value(), and ConfigVariableFilename::get_default_value().
|
inline |
Returns the integer value of the nth word of the variable's value, or 0 if there is no nth value.
See also has_double_word().
Definition at line 263 of file configVariable.I.
References ConfigDeclaration::get_double_word(), and set_string_word().
Referenced by get_int64_word(), ConfigVariableDouble::get_value(), ConfigVariableColor::get_value(), and ConfigVariableDouble::get_word().
|
inline |
Returns the int64 value of the nth word of the variable's value, or 0 if there is no nth value.
See also has_int_word().
Definition at line 249 of file configVariable.I.
References get_double_word(), and ConfigDeclaration::get_int64_word().
Referenced by get_int_word(), ConfigVariableInt64::get_value(), and ConfigVariableInt64::get_word().
|
inline |
Returns the integer value of the nth word of the variable's value, or 0 if there is no nth value.
See also has_int_word().
Definition at line 235 of file configVariable.I.
References get_int64_word(), and ConfigDeclaration::get_int_word().
Referenced by get_bool_word(), ConfigVariableInt::get_value(), and ConfigVariableInt::get_word().
|
inline |
Returns the number of words in the variable's value.
A word is defined as a sequence of non-whitespace characters delimited by whitespace.
Definition at line 126 of file configVariable.I.
References ConfigDeclaration::get_num_words(), and has_string_word().
Referenced by CullBinManager::add_bin(), clear_value(), WindowProperties::get_config_properties(), FrameBufferProperties::get_default(), ConfigVariableColor::get_value(), SpeedTreeNode::reload_config(), ConfigVariableBool::size(), ConfigVariableDouble::size(), ConfigVariableInt::size(), ConfigVariableInt64::size(), and ConfigVariableEnum< NotifySeverity >::size().
|
inline |
Returns the toplevel value of the variable, formatted as a string.
Definition at line 85 of file configVariable.I.
References ConfigDeclaration::get_string_value(), and set_string_value().
Referenced by get_default_value(), ConfigVariableEnum< NotifySeverity >::get_value(), ConfigVariableColor::get_value(), and ConfigDeclaration::set_double_word().
|
inline |
Returns the string value of the nth word of the variable's value, or empty string if there is no nth value.
See also has_string_word().
Definition at line 207 of file configVariable.I.
References get_bool_word(), and ConfigDeclaration::get_string_word().
Referenced by ConfigVariableString::get_word(), ConfigVariableEnum< NotifySeverity >::get_word(), ConfigVariableFilename::get_word(), and has_double_word().
|
inline |
Returns true if the variable's value has a valid boolean value for the nth word.
Definition at line 154 of file configVariable.I.
References ConfigDeclaration::has_bool_word(), and has_int_word().
Referenced by has_string_word().
|
inline |
Returns true if the variable's value has a valid integer value for the nth word.
Definition at line 193 of file configVariable.I.
References get_string_word(), and ConfigDeclaration::has_double_word().
Referenced by has_int64_word().
|
inline |
Returns true if the variable's value has a valid 64-bit integer value for the nth word.
Definition at line 180 of file configVariable.I.
References has_double_word(), and ConfigDeclaration::has_int64_word().
Referenced by has_int_word().
|
inline |
Returns true if the variable's value has a valid integer value for the nth word.
Definition at line 167 of file configVariable.I.
References has_int64_word(), and ConfigDeclaration::has_int_word().
Referenced by has_bool_word().
|
inline |
Returns true if the variable'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.
Definition at line 141 of file configVariable.I.
References has_bool_word(), and ConfigDeclaration::has_string_word().
Referenced by get_num_words().
|
inline |
Changes the nth word to the indicated value without affecting the other words.
Definition at line 288 of file configVariable.I.
References set_int_word().
Referenced by set_string_word(), ConfigVariableBool::set_value(), and ConfigVariableBool::set_word().
|
inline |
Changes the nth word to the indicated value without affecting the other words.
Definition at line 324 of file configVariable.I.
Referenced by set_int64_word(), ConfigVariableDouble::set_value(), ConfigVariableColor::set_value(), and ConfigVariableDouble::set_word().
|
inline |
Changes the nth word to the indicated value without affecting the other words.
Definition at line 312 of file configVariable.I.
References set_double_word().
Referenced by set_int_word(), ConfigVariableInt64::set_value(), and ConfigVariableInt64::set_word().
|
inline |
Changes the nth word to the indicated value without affecting the other words.
Definition at line 300 of file configVariable.I.
References set_int64_word().
Referenced by set_bool_word(), ConfigVariableInt::set_value(), and ConfigVariableInt::set_word().
|
inline |
Changes the value assigned to this variable.
This creates a local value that shadows any values defined in the .prc files, until clear_local_value() is called.
Definition at line 100 of file configVariable.I.
References clear_value().
Referenced by get_string_value(), ConfigVariableBool::set_value(), ConfigVariableDouble::set_value(), ConfigVariableInt::set_value(), ConfigVariableInt64::set_value(), ConfigVariableString::set_value(), ConfigVariableEnum< NotifySeverity >::set_value(), ConfigVariableColor::set_value(), and ConfigVariableFilename::set_value().
|
inline |
Changes the nth word to the indicated value without affecting the other words.
Definition at line 276 of file configVariable.I.
References set_bool_word().
Referenced by get_double_word(), ConfigDeclaration::set_bool_word(), ConfigDeclaration::set_double_word(), ConfigDeclaration::set_int64_word(), ConfigDeclaration::set_int_word(), ConfigVariableString::set_word(), ConfigVariableEnum< NotifySeverity >::set_word(), and ConfigVariableFilename::set_word().