The Battle for Wesnoth  1.19.7+dev
Namespaces | Functions
config_filters.hpp File Reference
#include "config.hpp"
Include dependency graph for config_filters.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 utils
 
 utils::config_filters
 Utility functions for implementing [filter], [filter_ability], [filter_weapon], etc.
 

Functions

bool utils::config_filters::bool_matches_if_present (const config &filter, const config &cfg, const std::string &attribute, bool def)
 Checks whether the filter matches the value of cfg[attribute]. More...
 
bool utils::config_filters::double_matches_if_present (const config &filter, const config &cfg, const std::string &attribute, utils::optional< double > def=utils::nullopt)
 Checks whether the filter matches the value of cfg[attribute]. More...
 
bool utils::config_filters::int_matches_if_present (const config &filter, const config &cfg, const std::string &attribute, utils::optional< int > def=utils::nullopt)
 
bool utils::config_filters::int_matches_if_present_or_negative (const config &filter, const config &cfg, const std::string &attribute, const std::string &opposite, utils::optional< int > def=utils::nullopt)
 Supports filters using "add" and "sub" attributes, for example a filter add=1 matching a cfg containing either add=1 or sub=-1; this assumes that code elsewhere has already checked that cfg contains at most one of those keys. More...
 
bool utils::config_filters::string_matches_if_present (const config &filter, const config &cfg, const std::string &attribute, const std::string &def)
 
bool utils::config_filters::set_includes_if_present (const config &filter, const config &cfg, const std::string &attribute)
 filter[attribute] and cfg[attribute] are assumed to be comma-separated lists. More...
 
bool utils::config_filters::bool_or_empty (const config &filter, const config &cfg, const std::string &attribute)