#include <variable.hpp>
Public Types | |
enum | TYPE { TYPE_SCALAR, TYPE_ARRAY, TYPE_CONTAINER, TYPE_UNSPECIFIED } |
TYPE: the correct variable type should be decided by the user of the info structure Note: an Array can also be considered a Container, since index 0 will be used by default. More... | |
typedef std::pair< std::vector < config * >::iterator, std::vector< config * > ::iterator > | array_range |
Public Member Functions | |
variable_info (const std::string &varname, bool force_valid=true, TYPE validation_type=TYPE_UNSPECIFIED) | |
t_string & | as_scalar () |
Results: after deciding the desired type, these methods can retrieve the result Note: first you should force_valid or check is_valid, otherwise these may fail. | |
config & | as_container () |
array_range | as_array () |
Public Attributes | |
TYPE | vartype |
bool | is_valid |
std::string | key |
bool | explicit_index |
size_t | index |
config * | vars |
Definition at line 155 of file variable.hpp.
typedef std::pair<std::vector<config*>::iterator, std::vector<config*>::iterator> variable_info::array_range |
Definition at line 157 of file variable.hpp.
enum variable_info::TYPE |
TYPE: the correct variable type should be decided by the user of the info structure Note: an Array can also be considered a Container, since index 0 will be used by default.
Definition at line 163 of file variable.hpp.
variable_info::variable_info | ( | const std::string & | varname, | |
bool | force_valid = true , |
|||
TYPE | validation_type = TYPE_UNSPECIFIED | |||
) |
Definition at line 524 of file variable.cpp.
References activate_scope_variable(), config::add_child(), config::child(), ERR_NG, explicit_index, config::get_children(), config::has_attribute(), index, is_valid, key, lexical_cast(), game_config::max_loop, size, game_state::temporaries, TYPE_ARRAY, TYPE_CONTAINER, TYPE_SCALAR, TYPE_UNSPECIFIED, game_state::variables, vars, vartype, and WRN_NG.
t_string & variable_info::as_scalar | ( | ) |
Results: after deciding the desired type, these methods can retrieve the result Note: first you should force_valid or check is_valid, otherwise these may fail.
Definition at line 660 of file variable.cpp.
References is_valid, key, config::values, and vars.
Referenced by game_state::get_variable_const().
config & variable_info::as_container | ( | ) |
Definition at line 665 of file variable.cpp.
References config::add_child(), config::child(), explicit_index, config::get_children(), index, is_valid, key, and vars.
Referenced by vconfig::child(), vconfig::all_children_iterator::get_child(), vconfig::get_children(), terrain_filter::get_locations(), vconfig::get_parsed_config(), and terrain_filter::match_internal().
variable_info::array_range variable_info::as_array | ( | ) |
Definition at line 680 of file variable.cpp.
References config::child_range(), is_valid, key, and vars.
Referenced by vconfig::all_children_iterator::get_child(), vconfig::get_children(), terrain_filter::get_locations(), vconfig::get_parsed_config(), terrain_filter::match_internal(), and vconfig::all_children_iterator::operator++().
Definition at line 172 of file variable.hpp.
Referenced by as_array(), as_container(), as_scalar(), vconfig::child(), game_state::clear_variable(), game_state::clear_variable_cfg(), vconfig::all_children_iterator::get_child(), vconfig::get_children(), terrain_filter::get_locations(), vconfig::get_parsed_config(), game_state::get_variable_const(), unit::internal_matches_filter(), terrain_filter::match_internal(), vconfig::all_children_iterator::operator++(), and variable_info().
std::string variable_info::key |
Definition at line 173 of file variable.hpp.
Referenced by game_state::add_variable_cfg(), as_array(), as_container(), as_scalar(), game_state::clear_variable(), game_state::clear_variable_cfg(), unit::internal_matches_filter(), and variable_info().
Definition at line 174 of file variable.hpp.
Referenced by as_container(), game_state::clear_variable(), game_state::clear_variable_cfg(), vconfig::get_children(), terrain_filter::get_locations(), vconfig::get_parsed_config(), unit::internal_matches_filter(), terrain_filter::match_internal(), vconfig::all_children_iterator::operator++(), and variable_info().
size_t variable_info::index |
Definition at line 175 of file variable.hpp.
Referenced by as_container(), game_state::clear_variable(), game_state::clear_variable_cfg(), unit::internal_matches_filter(), and variable_info().
Definition at line 176 of file variable.hpp.
Referenced by game_state::add_variable_cfg(), as_array(), as_container(), as_scalar(), game_state::clear_variable(), game_state::clear_variable_cfg(), unit::internal_matches_filter(), and variable_info().
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |