Panda3D
Public Member Functions | Public Attributes | 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. 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. More...
 
int getDeclSeq ()
 Returns the sequence number of the declaration within the page. 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. More...
 
Filename getFilenameValue ()
 Interprets the string value as a filename and returns it, with any variables expanded. More...
 
int64_t getInt64Word (int n)
 Returns the int64 value of the nth word of the declaration's value, or 0 if there is no nth value. 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. More...
 
int getNumWords ()
 Returns the number of words in the declaration's value. More...
 
ConfigPage getPage ()
 Returns the page on which this declaration can be found. More...
 
str getStringValue ()
 Returns the value assigned to this variable. 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. More...
 
ConfigVariableCore getVariable ()
 Returns the variable that this declaration names. 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. More...
 
 output (Ostream out)
 
 setBoolWord (int n, bool value)
 Changes the nth word to the indicated value without affecting the other words. More...
 
 setDoubleWord (int n, double value)
 Changes the nth word to the indicated value without affecting the other words. More...
 
 setInt64Word (int n, int64_t value)
 Changes the nth word to the indicated value without affecting the other words. More...
 
 setIntWord (int n, int value)
 Changes the nth word to the indicated value without affecting the other words. More...
 
 setStringValue (str value)
 Changes the value assigned to this variable. More...
 
 setStringWord (int n, str value)
 Changes the nth word to the indicated value without affecting the other words. More...
 
 write (Ostream out)
 
- Public Member Functions inherited from ConfigFlags
 __init__ ()
 
 __init__ (const ConfigFlags)
 

Public Attributes

ConfigPage page
 Returns the page on which this declaration can be found. More...
 
ConfigVariableCore variable
 Returns the variable that this declaration names. More...
 

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

◆ getFilenameValue()

Filename getFilenameValue ( )

Interprets the string value as a filename and returns it, with any variables expanded.

◆ getInt64Word()

int64_t 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 
)

Changes the nth word to the indicated value without affecting the other words.

◆ setDoubleWord()

setDoubleWord ( int  n,
double  value 
)

Changes the nth word to the indicated value without affecting the other words.

◆ setInt64Word()

setInt64Word ( int  n,
int64_t  value 
)

Changes the nth word to the indicated value without affecting the other words.

◆ setIntWord()

setIntWord ( int  n,
int  value 
)

Changes the nth word to the indicated value without affecting the other words.

◆ setStringValue()

setStringValue ( str  value)

Changes the value assigned to this variable.

◆ setStringWord()

setStringWord ( int  n,
str  value 
)

Changes the nth word to the indicated value without affecting the other words.

◆ write()

write ( Ostream  out)

Member Data Documentation

◆ page

ConfigPage page

Returns the page on which this declaration can be found.

◆ variable

Returns the variable that this declaration names.

This variable may or may not have been defined by the time the declaration is read.