20 #ifndef CONFIG_CACHE_HPP_INCLUDED
21 #define CONFIG_CACHE_HPP_INCLUDED
24 #include <boost/utility.hpp>
25 #include <boost/scoped_ptr.hpp>
26 #include <boost/shared_ptr.hpp>
53 T::instance().add_define(
name_);
63 T::instance().remove_define(
name_);
259 typedef boost::scoped_ptr<config_cache_transaction>
value_type;
static config_cache & instance()
Get reference to the singleton object.
config_cache_transaction()
void write_file(std::string file, const config &cfg)
void read_configs(const std::string &path, config &cfg, preproc_map &defines)
void read_file(const std::string &file, config &cfg)
void lock()
Lock the transaction so no more macros are added.
static config_cache_transaction * active_
void remove_define(const std::string &define)
Remove a entry to preproc defines map.
Holds a fake cache transaction if no real one is used.
~config_cache_transaction()
std::vector< std::string > define_filenames_
static config_cache_transaction & instance()
const std::vector< std::string > & get_define_files() const
std::map< std::string, preproc_define > preproc_map
Used to set and unset scoped defines to preproc_map.
GLsizei const char ** path
bool delete_cache_files(const std::vector< std::string > &paths, const std::string &exclude_pattern="")
bool clean_cache()
Deletes stale cache files not in use by the game.
void read_defines_file(const std::string &path)
const preproc_map & get_preproc_map() const
void get_config(const std::string &path, config &cfg)
Gets a config object from given path.
void add_define_file(const std::string &file)
void set_force_valid_cache(bool force)
Enable/disable cache validation.
void set_use_cache(bool use)
Enable/disable caching.
void load_configs(const std::string &path, config &cfg)
void clear_defines()
Clear stored defines map to default values.
void add_defines_map_diff(preproc_map &)
Game configuration data as global variables.
std::string cache_file_prefix_
preproc_map & get_active_map(const preproc_map &defines_map)
scoped_preproc_define_internal< config_cache > scoped_preproc_define
void read_cache(const std::string &path, config &cfg)
void set_force_invalid_cache(bool)
boost::scoped_ptr< config_cache_transaction > value_type
GLuint const GLchar * name
Used to share macros between cache objects You have to create transaction object to load all macros t...
void read_defines_queue()
scoped_preproc_define_internal(const std::string &name, bool add=true)
Adds normal preproc define.
void add_defines_map_diff(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.
A config object defines a single node in a WML file, with access to child nodes.
preproc_map & make_copy_map()
~scoped_preproc_define_internal()
This removes preproc define from cacher.
void add_define(const std::string &define)
Add a entry to preproc defines map.
GLsizei const GLcharARB ** string
void recheck_filetree_checksum()
Force cache checksum validation.
bool purge_cache()
Deletes all cache files.
Singleton class to manage game config file caching.