The Battle for Wesnoth  1.15.2+dev
Classes | Functions | Variables
savegame Namespace Reference


class  autosave_savegame
 Class for autosaves. More...
class  create_save_info
class  filename_filter
class  ingame_savegame
 Class for "normal" midgame saves. More...
class  load_game_exception
 Exception used to signal that the user has decided to abortt a game, and to load another game instead. More...
struct  load_game_metadata
class  loadgame
 The class for loading a savefile. More...
class  oos_savegame
class  replay_savegame
 Class for replay saves (either manually or automatically). More...
class  save_index_class
class  save_info
 Filename and modification date for a file list. More...
struct  save_info_less_time
 A structure for comparing to save_info objects based on their modified time. More...
class  savegame
 The base class for all savegame stuff. More...
class  scenariostart_savegame
 Class for start-of-scenario saves. More...


void extract_summary_from_config (config &, config &)
std::vector< save_infoget_saves_list (const std::string *dir, const std::string *filter)
 Get a list of available saves. More...
static filesystem::scoped_istream find_save_file (const std::string &name, const std::vector< std::string > &suffixes)
void read_save_file (const std::string &name, config &cfg, std::string *error_log)
 Read the complete config information out of a savefile. More...
void remove_old_auto_saves (const int autosavemax, const int infinite_auto_saves)
 Remove autosaves that are no longer needed (according to the autosave policy in the preferences). More...
void delete_game (const std::string &name)
 Delete a savegame. More...
bool save_game_exists (std::string name, compression::format compressed)
 Returns true if there is already a savegame with that name. More...
void clean_saves (const std::string &label)
 Delete all autosaves of a certain scenario. More...
static void convert_old_saves_1_11_0 (config &cfg)
static void convert_old_saves_1_13_0 (config &cfg)
static void convert_old_saves_1_13_1 (config &cfg)
void convert_old_saves (config &cfg)
 converts saves from older versions of wesnoth More...


save_index_class save_index_manager

Function Documentation

◆ clean_saves()

void savegame::savegame::clean_saves ( const std::string &  label)

Delete all autosaves of a certain scenario.

Definition at line 67 of file savegame.cpp.

References _(), delete_game(), get_saves_list(), LOG_SAVE, and save().

Referenced by campaign_controller::play_game(), and game_launcher::unit_test().

◆ convert_old_saves()

void savegame::savegame::convert_old_saves ( config cfg)

converts saves from older versions of wesnoth

Definition at line 819 of file savegame.cpp.

References convert_old_saves_1_11_0(), convert_old_saves_1_13_0(), convert_old_saves_1_13_1(), and LOG_RG.

Referenced by savegame::loadgame::load_game().

◆ convert_old_saves_1_11_0()

static void savegame::convert_old_saves_1_11_0 ( config cfg)

◆ convert_old_saves_1_13_0()

static void savegame::convert_old_saves_1_13_0 ( config cfg)

◆ convert_old_saves_1_13_1()

static void savegame::convert_old_saves_1_13_1 ( config cfg)

◆ delete_game()

void savegame::delete_game ( const std::string &  name)

◆ extract_summary_from_config()

void savegame::extract_summary_from_config ( config cfg_save,
config cfg_summary 

◆ find_save_file()

static filesystem::scoped_istream savegame::find_save_file ( const std::string &  name,
const std::vector< std::string > &  suffixes 

Definition at line 258 of file save_index.cpp.

References filesystem::get_saves_dir(), filesystem::istream_file(), and LOG_SAVE.

Referenced by read_save_file().

◆ get_saves_list()

std::vector< save_info > savegame::get_saves_list ( const std::string *  dir,
const std::string *  filter 

◆ read_save_file()

void savegame::savegame::read_save_file ( const std::string &  name,
config cfg,
std::string *  error_log 

◆ remove_old_auto_saves()

void savegame::savegame::remove_old_auto_saves ( const int  autosavemax,
const int  infinite_auto_saves 

Remove autosaves that are no longer needed (according to the autosave policy in the preferences).

Definition at line 315 of file save_index.cpp.

References _(), preferences::autosavemax(), preferences::countdown(), delete_game(), get_saves_list(), i, and LOG_SAVE.

Referenced by savegame::autosave_savegame::autosave().

◆ save_game_exists()

bool savegame::savegame::save_game_exists ( std::string  name,
compression::format  compressed 

Returns true if there is already a savegame with that name.

Definition at line 61 of file savegame.cpp.

References filesystem::file_exists(), compression::format_extension(), and filesystem::get_saves_dir().

Referenced by savegame::savegame::check_overwrite(), and play_controller::hotkey_handler::expand_autosaves().

Variable Documentation

◆ save_index_manager

save_index_class savegame::save_index_manager