49 vconfig(
const config & cfg,
const std::shared_ptr<const config> & cache);
70 explicit operator bool()
const {
return !
null(); }
82 bool has_child(
const std::string& key)
const;
190 boost::iterator_range<all_children_iterator>
all_ordered()
const {
202 mutable std::shared_ptr<const config>
cache_;
Variant for storing WML attributes.
config_variable_set(const config &cfg)
virtual config::attribute_value get_variable_const(const std::string &id) const
virtual variable_access_const get_variable_access_read(const std::string &varname) const
A config object defines a single node in a WML file, with access to child nodes.
const_attr_itors attribute_range() const
bool has_attribute(config_key_type key) const
boost::iterator_range< const_attribute_iterator > const_attr_itors
attribute_map::value_type attribute
unsigned int recall_index_
const std::string player_
scoped_recall_unit(const std::string &var_name, const std::string &player, unsigned int recall_index)
scoped_weapon_info(const std::string &var_name, optional_const_config data)
optional_const_config data_
scoped_wml_variable(const std::string &var_name)
virtual void activate()=0
config & store(const config &var_value=config())
virtual ~scoped_wml_variable()
const std::string var_name_
const std::string & name() const
scoped_xy_unit(const std::string &var_name, map_location loc, const unit_map &umap)
Container associating units to locations.
Information on a WML variable.
A variable-expanding proxy for the config class.
~vconfig()
Default destructor, but defined here for possibly faster compiles (templates sometimes can be rough o...
bool memory_managed() const
Returns true if *this has made a copy of its config.
all_children_iterator ordered_begin() const
In-order iteration over all children.
bool has_attribute(const std::string &key) const
< Synonym for operator[]
std::vector< vconfig > child_list
static vconfig unconstructed_vconfig()
This is just a wrapper for the default constructor; it exists for historical reasons and to make it c...
static vconfig empty_vconfig()
vconfig child(const std::string &key) const
Returns a child of *this whose key is key.
config::attribute_value expand(const std::string &) const
const config & get_config() const
config get_parsed_config() const
all_children_iterator ordered_end() const
const vconfig & make_safe() const
instruct the vconfig to make a private copy of its underlying data.
std::shared_ptr< const config > cache_
Keeps a copy of our config alive when we manage our own memory.
boost::iterator_range< all_children_iterator > all_ordered() const
static const config default_empty_config
const config * cfg_
Used to access our config (original or copy, as appropriate).
std::size_t count_children(const std::string &key) const
child_list get_children(const std::string &key) const
boost::iterator_range< attribute_iterator > attribute_range()
const variable_set * variables_
const config::attribute_value operator[](const std::string &key) const
Note: vconfig::operator[] returns const, and this should not be changed because vconfig is often used...
bool has_child(const std::string &key) const
Returns whether or not *this has a child whose key is key.
Definitions for the interface to Wesnoth Markup Language (WML).
static void msg(const char *act, debug_info &i, const char *to="", const char *result="")
Encapsulates the map of the game.
value_type * operator->() const
pointer_proxy(value_type p)
std::shared_ptr< const config > cache_
all_children_iterator(const Itor &i, const variable_set &vars)
const value_type reference
bool operator!=(const all_children_iterator &i) const
all_children_iterator & operator++()
const std::pair< std::string, vconfig > value_type
reference operator*() const
vconfig get_child() const
bool operator==(const all_children_iterator &i) const
config::const_all_children_iterator Itor
const variable_set * variables_
pointer operator->() const
const pointer_proxy pointer
std::string get_key() const
std::bidirectional_iterator_tag iterator_category
all_children_iterator & operator--()
value_type * operator->() const
pointer_proxy(value_type p)
config::const_attribute_iterator Itor
pointer operator->() const
reference operator*() const
bool operator==(const attribute_iterator &i) const
const pointer_proxy pointer
const config::attribute reference
attribute_iterator operator++(int)
attribute_iterator operator--(int)
const variable_set * variables_
attribute_iterator & operator++()
attribute_iterator & operator--()
bool operator!=(const attribute_iterator &i) const
const config::attribute value_type
attribute_iterator(const Itor &i, const variable_set &vars)
std::bidirectional_iterator_tag iterator_category
recursion_error(const std::string &msg)