The Battle for Wesnoth  1.19.0-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, std::optional< double > def=std::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, std::optional< int > def=std::nullopt)
 
bool utils::config_filters::unsigned_matches_if_present (const config &filter, const config &cfg, const std::string &attribute)
 Restricts filters to only looking for values that are zero or more. More...
 
bool utils::config_filters::int_matches_if_present_or_negative (const config &filter, const config &cfg, const std::string &attribute, const std::string &opposite, std::optional< int > def=std::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::bool_or_empty (const config &filter, const config &cfg, const std::string &attribute)