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. More... | |
size_t | get_num_values () const |
Returns the number of values in the variable. More... | |
std::string | get_string_value (size_t n) const |
Returns the nth value of the variable. More... | |
std::string | get_unique_value (size_t n) const |
Returns the nth unique value of the variable. More... | |
std::string | operator [] (size_t n) const |
Returns the nth unique value of the variable. More... | |
void | output (std::ostream &out) const |
size_t | size () const |
Returns the number of unique values of the variable. More... | |
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. More... | |
const std::string & | get_description () const |
int | get_flags () const |
Returns the flags value as set by set_flags(). More... | |
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. More... | |
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. More... | |
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. More... | |
get_name | |
Returns the name of the variable. More... | |
get_trust_level | |
Returns the minimum trust_level a prc file must demonstrate in order to redefine the value for this variable. More... | |
get_value_type | |
Returns the stated type of this variable. More... | |
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()). More... | |
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. More... | |
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 |
Returns the number of unique values in the variable.
Definition at line 68 of file configVariableList.I.
Referenced by size().
|
inline |
Returns the number of values in the variable.
Definition at line 46 of file configVariableList.I.
|
inline |
Returns the nth value of the variable.
Definition at line 55 of file configVariableList.I.
|
inline |
Returns the nth unique value of the variable.
Definition at line 77 of file configVariableList.I.
Referenced by 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 100 of file configVariableList.I.
References get_unique_value().
|
inline |
Returns the number of unique values of the variable.
Definition at line 90 of file configVariableList.I.
References get_num_unique_values().