Panda3D
|
This class is similar to ConfigVariable, but it reports its value as a list of strings. More...
#include "configVariableList.h"
Public Member Functions | |
ConfigVariableList (const std::string &name, const std::string &description=std::string(), int flags=0) | |
size_t | get_num_unique_values () const |
Returns the number of unique values in the variable. | |
size_t | get_num_values () const |
Returns the number of values in the variable. | |
std::string | get_string_value (size_t n) const |
Returns the nth value of the variable. | |
std::string | get_unique_value (size_t n) const |
Returns the nth unique value of the variable. | |
std::string | operator[] (size_t n) const |
Returns the nth unique value of the variable. | |
void | output (std::ostream &out) const |
size_t | size () const |
Returns the number of unique values of the variable. | |
void | write (std::ostream &out) const |
![]() | |
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. | |
const std::string & | get_description () const |
int | get_flags () const |
Returns the flags value as set by set_flags(). | |
const std::string & | get_name () const |
int | get_trust_level () const |
ValueType | get_value_type () const |
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. | |
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. | |
bool | is_closed () const |
bool | is_dynamic () const |
void | output (std::ostream &out) const |
void | write (std::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 } |
![]() | |
get_description | |
Returns the brief description of this variable, if it has been defined. | |
get_name | |
Returns the name of the variable. | |
get_trust_level | |
Returns the minimum trust_level a prc file must demonstrate in order to redefine the value for this variable. | |
get_value_type | |
Returns the stated type of this variable. | |
is_closed | |
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()). | |
is_dynamic | |
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. | |
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.
Definition at line 31 of file configVariableList.h.
|
inline |
Definition at line 24 of file configVariableList.I.
|
inline |
Definition at line 17 of file configVariableList.I.
|
inline |
Returns the number of unique values in the variable.
Definition at line 67 of file configVariableList.I.
Referenced by Texture::adjust_size(), VirtualFileSystem::get_global_ptr(), MovieTypeRegistry::load_audio_types(), MovieTypeRegistry::load_video_types(), and size().
|
inline |
Returns the number of values in the variable.
Definition at line 45 of file configVariableList.I.
|
inline |
Returns the nth value of the variable.
Definition at line 54 of file configVariableList.I.
References ConfigDeclaration::get_string_value().
|
inline |
Returns the nth unique value of the variable.
Definition at line 76 of file configVariableList.I.
References ConfigDeclaration::get_string_value().
Referenced by Texture::adjust_size(), VirtualFileSystem::get_global_ptr(), MovieTypeRegistry::load_audio_types(), MovieTypeRegistry::load_video_types(), and operator[]().
|
inline |
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().
Definition at line 99 of file configVariableList.I.
References get_unique_value().
void ConfigVariableList::output | ( | std::ostream & | out | ) | const |
Definition at line 19 of file configVariableList.cxx.
|
inline |
Returns the number of unique values of the variable.
Definition at line 89 of file configVariableList.I.
References get_num_unique_values().
void ConfigVariableList::write | ( | std::ostream & | out | ) | const |
Definition at line 27 of file configVariableList.cxx.