Panda3D
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Public Member Functions
ConfigVariable Class Reference

This is a generic, untyped ConfigVariable. More...

Inheritance diagram for ConfigVariable:
ConfigVariableBase ConfigFlags ConfigVariableBool ConfigVariableDouble ConfigVariableFilename ConfigVariableInt ConfigVariableInt64 ConfigVariableString

List of all members.

Public Member Functions

 ConfigVariable (string name)
 Use this constructor to make a ConfigVariable of an unspecified type.
 clearValue ()
 Removes the value assigned to this variable, and lets its original value (as read from the prc files) show through.
bool getBoolWord (int n)
 Returns the boolean value of the nth word of the variable's value, or false if there is no nth value.
ConfigDeclaration const getDefaultValue ()
 Returns the default variable specified for this variable.
double getDoubleWord (int n)
 Returns the integer value of the nth word of the variable's value, or 0 if there is no nth value.
long long int getInt64Word (int n)
 Returns the int64 value of the nth word of the variable's value, or 0 if there is no nth value.
int getIntWord (int n)
 Returns the integer value of the nth word of the variable's value, or 0 if there is no nth value.
int getNumWords ()
 Returns the number of words in the variable's value.
string getStringValue ()
 Returns the toplevel value of the variable, formatted as a string.
string getStringWord (int n)
 Returns the string value of the nth word of the variable's value, or empty string if there is no nth value.
bool hasBoolWord (int n)
 Returns true if the variable's value has a valid boolean value for the nth word.
bool hasDoubleWord (int n)
 Returns true if the variable's value has a valid integer value for the nth word.
bool hasInt64Word (int n)
 Returns true if the variable's value has a valid 64-bit integer value for the nth word.
bool hasIntWord (int n)
 Returns true if the variable's value has a valid integer value for the nth word.
bool hasStringWord (int n)
 Returns true if the variable's value has a valid string value for the nth word.
 setBoolWord (int n, bool value)
 Changes the nth word to the indicated value without affecting the other words.
 setDoubleWord (int n, double value)
 Changes the nth word to the indicated value without affecting the other words.
 setInt64Word (int n, long long int value)
 Changes the nth word to the indicated value without affecting the other words.
 setIntWord (int n, int value)
 Changes the nth word to the indicated value without affecting the other words.
 setStringValue (string value)
 Changes the value assigned to this variable.
 setStringWord (int n, string value)
 Changes the nth word to the indicated value without affecting the other words.

Detailed Description

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.


Constructor & Destructor Documentation

ConfigVariable ( string  name)

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.


Member Function Documentation

Removes the value assigned to this variable, and lets its original value (as read from the prc files) show through.

bool getBoolWord ( int  n)

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

Returns the default variable specified for this variable.

If the variable has not yet been defined, this will return NULL.

Reimplemented in ConfigVariableString, ConfigVariableInt64, ConfigVariableInt, ConfigVariableFilename, ConfigVariableDouble, and ConfigVariableBool.

double getDoubleWord ( int  n)

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

long long int getInt64Word ( int  n)

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

int getIntWord ( int  n)

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

Returns the number of words in the variable's value.

A word is defined as a sequence of non-whitespace characters delimited by whitespace.

string getStringValue ( )

Returns the toplevel value of the variable, formatted as a string.

string getStringWord ( int  n)

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

bool hasBoolWord ( int  n)

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

bool hasDoubleWord ( int  n)

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

bool hasInt64Word ( int  n)

Returns true if the variable's value has a valid 64-bit integer value for the nth word.

bool hasIntWord ( int  n)

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

bool hasStringWord ( int  n)

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.

setBoolWord ( int  n,
bool  value 
)

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

setDoubleWord ( int  n,
double  value 
)

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

setInt64Word ( int  n,
long long int  value 
)

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

setIntWord ( int  n,
int  value 
)

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

setStringValue ( string  value)

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.

setStringWord ( int  n,
string  value 
)

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

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties