55 T::instance().add_define(
name_);
65 T::instance().remove_define(
name_);
177 const std::string& exclude_pattern =
"");
269 typedef std::unique_ptr<config_cache_transaction>
value_type;
Used in parsing config file.
A config object defines a single node in a WML file, with access to child nodes.
Used to share macros between cache objects You have to create transaction object to load all macros t...
~config_cache_transaction()
config_cache_transaction()
void add_defines_map_diff(preproc_map &defines_map)
std::vector< std::string > define_filenames_
static config_cache_transaction & instance()
const std::vector< std::string > & get_define_files() const
void lock()
Lock the transaction so no more macros are added.
preproc_map & get_active_map(const preproc_map &defines_map)
void insert_to_active(const preproc_map::value_type &def)
Used to let std::for_each insert new defines to active_map map to active.
config_cache_transaction(const config_cache_transaction &)=delete
static config_cache_transaction * active_
void add_define_file(const std::string &file)
config_cache_transaction & operator=(const config_cache_transaction &)=delete
Singleton class to manage game config file caching.
std::string cache_file_prefix_
void load_configs(const std::string &path, config &cfg, abstract_validator *validator=nullptr)
void add_define(const std::string &define)
Add a entry to preproc defines map.
config_cache & operator=(const config_cache &)=delete
void recheck_filetree_checksum()
Force cache checksum validation.
config_cache(const config_cache &)=delete
void read_cache(const std::string &path, config &cfg, abstract_validator *validator=nullptr)
void write_file(const std::string &file, const config &cfg)
bool purge_cache()
Deletes all cache files.
void set_use_cache(bool use)
Enable/disable caching.
void read_defines_queue()
void set_force_invalid_cache(bool)
static config_cache & instance()
Get reference to the singleton object.
preproc_map & make_copy_map()
const preproc_map & get_preproc_map() const
void remove_define(const std::string &define)
Remove a entry to preproc defines map.
void clear_defines()
Clear stored defines map to default values.
void read_configs(const std::string &path, config &cfg, preproc_map &defines, abstract_validator *validator=nullptr)
bool clean_cache()
Deletes stale cache files not in use by the game.
void read_file(const std::string &file, config &cfg)
bool delete_cache_files(const std::vector< std::string > &paths, const std::string &exclude_pattern="")
void read_defines_file(const std::string &path)
void add_defines_map_diff(preproc_map &)
void set_force_valid_cache(bool force)
Enable/disable cache validation.
void get_config(const std::string &path, config &cfg, abstract_validator *validator=nullptr)
Gets a config object from given path.
Holds a fake cache transaction if no real one is used.
fake_transaction & operator=(const fake_transaction &)=delete
std::unique_ptr< config_cache_transaction > value_type
fake_transaction(const fake_transaction &)=delete
Used to set and unset scoped defines to preproc_map.
~scoped_preproc_define_internal()
This removes preproc define from cacher.
scoped_preproc_define_internal(const scoped_preproc_define_internal &)=delete
scoped_preproc_define_internal & operator=(const scoped_preproc_define_internal &)=delete
scoped_preproc_define_internal(const std::string &name, bool add=true)
Adds normal preproc define.
Game configuration data as global variables.
scoped_preproc_define_internal< config_cache > scoped_preproc_define
std::map< std::string, struct preproc_define > preproc_map