23 class save_index_class;
39 const std::string&
name()
const 75 save_info operator()(
const std::string& filename)
const;
91 static std::shared_ptr<save_index_class> default_saves_dir();
93 std::vector<save_info> get_saves_list(
const std::string* filter=
nullptr);
96 void delete_game(
const std::string& name);
98 void rebuild(
const std::string& name);
99 void rebuild(
const std::string& name,
const std::time_t&
modified);
102 void remove(
const std::string&
name);
103 void set_modified(
const std::string& name,
const std::time_t& modified);
106 const std::string& dir()
const;
109 void delete_old_auto_saves(
const int autosavemax,
const int infinite_auto_saves);
112 void write_save_index();
126 static void fix_leader_image_path(
config& data);
128 void clean_up_index();
bool clean_up_index_
Flag to only run the clean_up_index method once.
friend class create_save_info
Definitions for the interface to Wesnoth Markup Language (WML).
void read_save_file(const std::string &dir, const std::string &name, config &cfg, std::string *error_log)
Read the complete config information out of a savefile.
const config & summary() const
std::shared_ptr< save_index_class > manager_
std::string format_time_local() const
create_for_default_saves_dir
Syntatic sugar for choosing which constructor to use.
bool read_only_
The instance for default_saves_dir() writes a cache file.
const std::string & name() const
const std::time_t & modified() const
std::shared_ptr< save_index_class > save_index_
save_info(const std::string &name, const std::shared_ptr< save_index_class > &index, const std::time_t &modified)
std::size_t index(const std::string &str, const std::size_t index)
Codepoint index corresponding to the nth character in a UTF-8 string.
Filename and modification date for a file list.
std::map< std::string, std::time_t > modified_
std::string format_time_summary() const
bool read_only()
If true, all of delete_game, delete_old_auto_saves and write_save_index will be no-ops.
A config object defines a single node in a WML file, with access to child nodes.
A structure for comparing to save_info objects based on their modified time.