The Battle for Wesnoth  1.17.0-dev
Public Member Functions | Private Attributes | List of all members
schema_validation::wml_condition Class Reference

Stores information about a conditional portion of a tag. More...

#include <tag.hpp>

Inheritance diagram for schema_validation::wml_condition:

Public Member Functions

 wml_condition (const config &info, const config &filter)
 
bool matches (const config &cfg) const
 
- Public Member Functions inherited from schema_validation::wml_tag
 wml_tag ()
 
 wml_tag (const std::string &name, int min, int max, const std::string &super="", bool any=false)
 
 wml_tag (const config &)
 
 ~wml_tag ()
 
void print (std::ostream &os)
 Prints information about tag to outputstream, recursively is used to print tag info the format is next [tag] subtags keys name="name" min="min" max="max" [/tag]. More...
 
const std::string & get_name () const
 
int get_min () const
 
int get_max () const
 
int get_min_children () const
 
int get_max_children () const
 
const std::string & get_super () const
 
bool is_extension () const
 
bool is_fuzzy () const
 
bool accepts_any_tag () const
 
void set_name (const std::string &name)
 
void set_min (int o)
 
void set_max (int o)
 
void set_min_children (int o)
 
void set_max_children (int o)
 
void set_min (const std::string &s)
 
void set_max (const std::string &s)
 
void set_min_children (const std::string &s)
 
void set_max_children (const std::string &s)
 
void set_super (const std::string &s)
 
void set_fuzzy (bool f)
 
void set_any_tag (bool any)
 
void add_key (const wml_key &new_key)
 
void add_tag (const wml_tag &new_tag)
 
void add_link (const std::string &link)
 
void add_switch (const config &switch_cfg)
 
void add_filter (const config &cond_cfg)
 
void add_tag (const std::string &path, const wml_tag &tag, wml_tag &root)
 Tags are usually organized in tree. More...
 
bool operator< (const wml_tag &t) const
 
bool operator== (const wml_tag &other) const
 
const wml_keyfind_key (const std::string &name, const config &match, bool ignore_super=false) const
 Returns pointer to child key. More...
 
const std::string * find_link (const std::string &name) const
 Returns pointer to child link. More...
 
const wml_tagfind_tag (const std::string &fullpath, const wml_tag &root, const config &match, bool ignore_super=false) const
 Returns pointer to tag using full path to it. More...
 
void expand_all (wml_tag &root)
 Calls the expansion on each child. More...
 
boost::iterator_range< tag_iteratortags (const config &cfg_match) const
 
boost::iterator_range< key_iteratorkeys (const config &cfg_match) const
 
const link_maplinks () const
 
const condition_listconditions () const
 
void remove_key_by_name (const std::string &name)
 
void remove_keys_by_type (const std::string &type)
 Removes all keys with this type. More...
 

Private Attributes

config filter_
 

Additional Inherited Members

- Public Types inherited from schema_validation::wml_tag
using tag_map = std::map< std::string, wml_tag >
 
using key_map = std::map< std::string, wml_key >
 
using link_map = std::map< std::string, std::string >
 
using condition_list = std::vector< wml_condition >
 
using super_list = std::vector< wml_tag * >
 

Detailed Description

Stores information about a conditional portion of a tag.

Format is the same as wml_tag.

Definition at line 414 of file tag.hpp.

Constructor & Destructor Documentation

◆ wml_condition()

schema_validation::wml_condition::wml_condition ( const config info,
const config filter 
)
inline

Definition at line 417 of file tag.hpp.

Member Function Documentation

◆ matches()

bool schema_validation::wml_condition::matches ( const config cfg) const

Definition at line 446 of file tag.cpp.

References config::empty(), and config::matches().

Member Data Documentation

◆ filter_

config schema_validation::wml_condition::filter_
private

Definition at line 415 of file tag.hpp.


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