Panda3D
Public Member Functions | List of all members
ConfigDeclaration Class Reference

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. More...

Inheritance diagram for ConfigDeclaration:
ConfigFlags

Public Member Functions

bool getBoolWord (int n)
 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(). More...
 
int getDeclSeq ()
 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. More...
 
double getDoubleWord (int n)
 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(). More...
 
PNInt64 getInt64Word (int n)
 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(). More...
 
int getIntWord (int n)
 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(). More...
 
int getNumWords ()
 Returns the number of words in the declaration's value. A word is defined as a sequence of non-whitespace characters delimited by whitespace. More...
 
ConfigPage getPage ()
 Returns the page on which this declaration can be found. More...
 
str getStringValue ()
 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()). More...
 
str getStringWord (int n)
 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(). More...
 
ConfigVariableCore getVariable ()
 Returns the variable that this declaration names. This variable may or may not have been defined by the time the declaration is read. More...
 
bool hasBoolWord (int n)
 Returns true if the declaration's value has a valid boolean value for the nth word. More...
 
bool hasDoubleWord (int n)
 Returns true if the declaration's value has a valid integer value for the nth word. More...
 
bool hasInt64Word (int n)
 Returns true if the declaration's value has a valid int64 value for the nth word. More...
 
bool hasIntWord (int n)
 Returns true if the declaration's value has a valid integer value for the nth word. More...
 
bool hasStringWord (int n)
 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. More...
 
 output (Ostream out)
 
 setBoolWord (int n, bool value)
 
 setDoubleWord (int n, double value)
 
 setInt64Word (int n, PNInt64 value)
 
 setIntWord (int n, int value)
 
 setStringValue (str value)
 Changes the value assigned to this variable. More...
 
 setStringWord (int n, str value)
 
 write (Ostream out)
 

Additional Inherited Members

- Public Types inherited from ConfigFlags
enum  ValueType {
  VT_undefined = 0, VT_list = 1, VT_string = 2, VT_filename = 3,
  VT_bool = 4, VT_int = 5, VT_double = 6, VT_enum = 7,
  VT_search_path = 8, VT_int64 = 9, VT_color = 10
}
 
enum  VariableFlags {
  F_trust_level_mask = 4095, F_open = 4096, F_closed = 8192, F_dynamic = 16384,
  F_dconfig = 32768
}
 

Detailed Description

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.

Member Function Documentation

◆ getBoolWord()

bool getBoolWord ( int  n)

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

◆ getDeclSeq()

int getDeclSeq ( )

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.

◆ getDoubleWord()

double getDoubleWord ( int  n)

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

◆ getInt64Word()

PNInt64 getInt64Word ( int  n)

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

◆ getIntWord()

int getIntWord ( int  n)

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

◆ getNumWords()

int getNumWords ( )

Returns the number of words in the declaration's value. A word is defined as a sequence of non-whitespace characters delimited by whitespace.

◆ getPage()

ConfigPage getPage ( )

Returns the page on which this declaration can be found.

◆ getStringValue()

str getStringValue ( )

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

◆ getStringWord()

str getStringWord ( int  n)

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

◆ getVariable()

ConfigVariableCore getVariable ( )

Returns the variable that this declaration names. This variable may or may not have been defined by the time the declaration is read.

◆ hasBoolWord()

bool hasBoolWord ( int  n)

Returns true if the declaration's value has a valid boolean value for the nth word.

◆ hasDoubleWord()

bool hasDoubleWord ( int  n)

Returns true if the declaration's value has a valid integer value for the nth word.

◆ hasInt64Word()

bool hasInt64Word ( int  n)

Returns true if the declaration's value has a valid int64 value for the nth word.

◆ hasIntWord()

bool hasIntWord ( int  n)

Returns true if the declaration's value has a valid integer value for the nth word.

◆ hasStringWord()

bool hasStringWord ( int  n)

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.

◆ output()

output ( Ostream  out)

◆ setBoolWord()

setBoolWord ( int  n,
bool  value 
)

◆ setDoubleWord()

setDoubleWord ( int  n,
double  value 
)

◆ setInt64Word()

setInt64Word ( int  n,
PNInt64  value 
)

◆ setIntWord()

setIntWord ( int  n,
int  value 
)

◆ setStringValue()

setStringValue ( str  value)

Changes the value assigned to this variable.

◆ setStringWord()

setStringWord ( int  n,
str  value 
)

◆ write()

write ( Ostream  out)