vconfig Class Reference

A variable-expanding proxy for the config class. More...

#include <variable.hpp>

Collaboration diagram for vconfig:

Collaboration graph
[legend]

List of all members.

Public Types

typedef std::vector< vconfigchild_list

Public Member Functions

 vconfig ()
 vconfig (const vconfig &v)
 vconfig (const config *cfg, const config *cache_key=NULL)
 ~vconfig ()
vconfigoperator= (const vconfig cfg)
vconfigoperator= (const config *cfg)
bool null () const
const configget_config () const
const config get_parsed_config () const
child_list get_children (const std::string &key) const
vconfig child (const std::string &key) const
bool has_child (const std::string &key) const
const t_string expand (const std::string &) const
const t_string operator[] (const std::string &key) const
 < Synonym for operator[]
const t_stringget_attribute (const std::string &key) const
bool has_attribute (const std::string &key) const
bool empty () const
all_children_iterator ordered_begin () const
 In-order iteration over all children.
all_children_iterator ordered_end () const

Private Attributes

const configcfg_
const configcache_key_
std::set< std::string > recursion_

Classes

struct  all_children_iterator


Detailed Description

A variable-expanding proxy for the config class.

This class roughly behaves as a constant config object, but automatically expands variables.

Definition at line 34 of file variable.hpp.


Member Typedef Documentation

typedef std::vector<vconfig> vconfig::child_list

Definition at line 49 of file variable.hpp.


Constructor & Destructor Documentation

vconfig::vconfig (  ) 

vconfig::vconfig ( const vconfig v  ) 

Definition at line 166 of file variable.cpp.

References cache_key_, and increment_config_usage().

vconfig::vconfig ( const config cfg,
const config cache_key = NULL 
)

Definition at line 156 of file variable.cpp.

References cache_key_, cfg_, and increment_config_usage().

vconfig::~vconfig (  ) 

Definition at line 172 of file variable.cpp.

References cache_key_, and decrement_config_usage().


Member Function Documentation

vconfig & vconfig::operator= ( const vconfig  cfg  ) 

Definition at line 177 of file variable.cpp.

References cache_key_, cfg_, decrement_config_usage(), and increment_config_usage().

vconfig & vconfig::operator= ( const config cfg  ) 

Definition at line 187 of file variable.cpp.

References cache_key_, cfg_, and decrement_config_usage().

bool vconfig::null (  )  const [inline]

Definition at line 45 of file variable.hpp.

References cfg_.

Referenced by empty().

const config& vconfig::get_config (  )  const [inline]

Definition at line 46 of file variable.hpp.

References cfg_.

Referenced by get_parsed_config().

const config vconfig::get_parsed_config (  )  const

vconfig::child_list vconfig::get_children ( const std::string &  key  )  const

vconfig vconfig::child ( const std::string &  key  )  const

bool vconfig::has_child ( const std::string &  key  )  const

const t_string vconfig::expand ( const std::string &  key  )  const

Definition at line 319 of file variable.cpp.

References utils::interpolate_variables_into_string(), and t_string::str().

Referenced by get_parsed_config(), and operator[]().

const t_string vconfig::operator[] ( const std::string &  key  )  const [inline]

< Synonym for operator[]

Definition at line 55 of file variable.hpp.

References expand().

const t_string& vconfig::get_attribute ( const std::string &  key  )  const [inline]

Definition at line 56 of file variable.hpp.

References cfg_.

Referenced by game_events::internal_conditional_passed().

bool vconfig::has_attribute ( const std::string &  key  )  const [inline]

bool vconfig::empty (  )  const [inline]

Definition at line 58 of file variable.hpp.

References cfg_, config::empty(), and null().

vconfig::all_children_iterator vconfig::ordered_begin (  )  const

In-order iteration over all children.

Definition at line 411 of file variable.cpp.

References cfg_, and config::ordered_begin().

Referenced by game_events::conditional_passed(), terrain_filter::get_locations(), unit::matches_filter(), and game_events::matches_special_filter().

vconfig::all_children_iterator vconfig::ordered_end (  )  const


Member Data Documentation

const config* vconfig::cfg_ [private]

const config* vconfig::cache_key_ [private]

Definition at line 94 of file variable.hpp.

Referenced by child(), get_children(), operator=(), vconfig(), and ~vconfig().

std::set<std::string> vconfig::recursion_ [mutable, private]

Definition at line 95 of file variable.hpp.

Referenced by get_parsed_config().


The documentation for this class was generated from the following files:

Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs