Panda3D
Public Types | Public Member Functions

ConfigVariableList Class Reference

This class is similar to ConfigVariable, but it reports its value as a list of strings. More...

Inheritance diagram for ConfigVariableList:
ConfigVariableBase ConfigFlags

List of all members.

Public Types

enum  ValueType {
  VTUndefined = 0, VTList = 1, VTString = 2, VTFilename = 3,
  VTBool = 4, VTInt = 5, VTDouble = 6, VTEnum = 7,
  VTSearchPath = 8, VTInt64 = 9
}
enum  VariableFlags {
  FTrustLevelMask = 4095, FOpen = 4096, FClosed = 8192, FDynamic = 16384,
  FDconfig = 32768
}

Public Member Functions

 ConfigVariableList (string name, string description, int flags)
 ConfigVariableList (string name, string description)
 ConfigVariableList (string name)
bool clearLocalValue ()
 Removes the local value defined for this variable, and allows its value to be once again retrieved from the .prc files.
string getDescription ()
 Returns the brief description of this variable, if it has been defined.
int getFlags ()
 Returns the flags value as set by set_flags().
string getName ()
 Returns the name of the variable.
int getNumUniqueValues ()
 Returns the number of unique values in the variable.
int getNumValues ()
 Returns the number of values in the variable.
string getStringValue (int n)
 Returns the nth value of the variable.
int getTrustLevel ()
 Returns the minimum trust_level a prc file must demonstrate in order to redefine the value for this variable.
string getUniqueValue (int n)
 Returns the nth unique value of the variable.
ValueType getValueType ()
 Returns the stated type of this variable.
bool hasLocalValue ()
 Returns true if this variable's value has been shadowed by a local assignment (as created via make_local_value()), or false otherwise.
bool hasValue ()
 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.
bool isClosed ()
 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()).
bool isDynamic ()
 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.
string operator[] (int n)
 Returns the nth unique value of the variable.
 output (ostream out)
int size ()
 Returns the number of unique values of the variable.
 write (ostream out)

Detailed Description

This class is similar to ConfigVariable, but it reports its value as a list of strings.

In this special case, all of the declarations of the variable are returned as the elements of this list, in order.

Note that this is different from a normal ConfigVariableString, which just returns its topmost value, which can optionally be treated as a number of discrete words by dividing it at the spaces.

A ConfigVariableList cannot be modified locally.


Member Enumeration Documentation

enum ValueType [inherited]
Enumerator:
VTUndefined 
VTList 
VTString 
VTFilename 
VTBool 
VTInt 
VTDouble 
VTEnum 
VTSearchPath 
VTInt64 
enum VariableFlags [inherited]
Enumerator:
FTrustLevelMask 
FOpen 
FClosed 
FDynamic 
FDconfig 

Constructor & Destructor Documentation

ConfigVariableList ( string  name,
string  description,
int  flags 
)
ConfigVariableList ( string  name,
string  description 
)
ConfigVariableList ( string  name)

Member Function Documentation

bool clearLocalValue ( ) [inherited]

Removes the local value defined for this variable, and allows its value to be once again retrieved from the .prc files.

Returns true if the value was successfully removed, false if it did not exist in the first place.

Reimplemented in ConfigVariableSearchPath.

string getDescription ( ) [inherited]

Returns the brief description of this variable, if it has been defined.

int getFlags ( ) [inherited]

Returns the flags value as set by set_flags().

This includes the trust level and some other settings. See the individual methods is_closed(), get_trust_level(), etc. to pull out the semantic meaning of these flags individually.

string getName ( ) [inherited]

Returns the name of the variable.

int getNumUniqueValues ( )

Returns the number of unique values in the variable.

int getNumValues ( )

Returns the number of values in the variable.

string getStringValue ( int  n)

Returns the nth value of the variable.

int getTrustLevel ( ) [inherited]

Returns the minimum trust_level a prc file must demonstrate in order to redefine the value for this variable.

Arguably, this should be called the "mistrust level", since the larger the value, the more suspicious we are of prc files. This value is not used if is_closed() returns true, which indicates no file may be trusted.

This value only has effect in a release build (specifically, when PRC_RESPECT_TRUST_LEVEL is defined true in Config.pp).

string getUniqueValue ( int  n)

Returns the nth unique value of the variable.

ValueType getValueType ( ) [inherited]

Returns the stated type of this variable.

This should be VT_list, unless a later variable declaration has changed it.

bool hasLocalValue ( ) [inherited]

Returns true if this variable's value has been shadowed by a local assignment (as created via make_local_value()), or false otherwise.

bool hasValue ( ) [inherited]

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.

bool isClosed ( ) [inherited]

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

This value only has effect in a release build (specifically, when PRC_RESPECT_TRUST_LEVEL is defined true in Config.pp).

bool isDynamic ( ) [inherited]

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.

string operator[] ( int  n)

Returns the nth unique value of the variable.

Note that the indexing operator returns the list of unique values, and so the maximum range is get_num_unique_values().

output ( ostream  out)

Reimplemented from ConfigVariableBase.

int size ( )

Returns the number of unique values of the variable.

write ( ostream  out)

Reimplemented from ConfigVariableBase.

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties