The Battle for Wesnoth  1.19.5+dev
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
game_config_view Class Reference

A class grating read only view to a vector of config objects, viewed as one config with all children appended, used by the game_config class to read data from addons config, and from the main config. More...

#include <game_config_view.hpp>

Public Member Functions

 game_config_view ()
 
config_array_view child_range (config_key_type key) const
 
optional_const_config find_child (config_key_type key, const std::string &name, const std::string &value) const
 
const configfind_mandatory_child (config_key_type key, const std::string &name, const std::string &value) const
 
const configmandatory_child (config_key_type key) const
 
optional_const_config optional_child (config_key_type key) const
 
const configchild_or_empty (config_key_type key) const
 
game_config_view merged_children_view (config_key_type key) const
 
config_array_viewdata ()
 

Static Public Member Functions

static game_config_view wrap (const config &cfg)
 

Private Member Functions

 game_config_view (const config &cfg)
 

Private Attributes

config_array_view cfgs_
 

Detailed Description

A class grating read only view to a vector of config objects, viewed as one config with all children appended, used by the game_config class to read data from addons config, and from the main config.

Definition at line 30 of file game_config_view.hpp.

Constructor & Destructor Documentation

◆ game_config_view() [1/2]

game_config_view::game_config_view ( )
inline

Definition at line 34 of file game_config_view.hpp.

Referenced by wrap().

◆ game_config_view() [2/2]

game_config_view::game_config_view ( const config cfg)
inlineexplicitprivate

Definition at line 63 of file game_config_view.hpp.

References cfgs_.

Member Function Documentation

◆ child_or_empty()

const config & game_config_view::child_or_empty ( config_key_type  key) const

Definition at line 91 of file game_config_view.cpp.

References cfgs_.

Referenced by help::generate_contents().

◆ child_range()

config_array_view game_config_view::child_range ( config_key_type  key) const

◆ data()

config_array_view& game_config_view::data ( )
inline

◆ find_child()

optional_const_config game_config_view::find_child ( config_key_type  key,
const std::string &  name,
const std::string &  value 
) const

◆ find_mandatory_child()

const config & game_config_view::find_mandatory_child ( config_key_type  key,
const std::string &  name,
const std::string &  value 
) const

◆ mandatory_child()

const config & game_config_view::mandatory_child ( config_key_type  key) const

◆ merged_children_view()

game_config_view game_config_view::merged_children_view ( config_key_type  key) const

◆ optional_child()

optional_const_config game_config_view::optional_child ( config_key_type  key) const

◆ wrap()

static game_config_view game_config_view::wrap ( const config cfg)
inlinestatic

Member Data Documentation

◆ cfgs_

config_array_view game_config_view::cfgs_
private

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