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

Classes

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  create_save_info
 
class  save_index_class
 
struct  load_game_metadata
 
class  load_game_exception
 Exception used to signal that the user has decided to abortt a game, and to load another game instead. More...
 
class  loadgame
 The class for loading a savefile. More...
 
class  savegame
 The base class for all savegame stuff. More...
 
class  ingame_savegame
 Class for "normal" midgame saves. More...
 
class  replay_savegame
 Class for replay saves (either manually or automatically). More...
 
class  autosave_savegame
 Class for autosaves. More...
 
class  oos_savegame
 
class  scenariostart_savegame
 Class for start-of-scenario saves. More...
 

Functions

void extract_summary_from_config (config &, config &)
 
static filesystem::scoped_istream find_save_file (const std::string &dir, const std::string &name, const std::vector< std::string > &suffixes)
 
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. More...
 
bool save_game_exists (std::string name, compression::format compressed)
 Returns true if there is already a savegame with this name, looking only in the default save directory. More...
 
void clean_saves (const std::string &label)
 Delete all autosaves of a certain scenario from the default save directory. 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)
 
static void convert_old_saves_1_15_3 (config &cfg)
 
void convert_old_saves (config &cfg)
 converts saves from older versions of wesnoth More...
 

Function Documentation

◆ clean_saves()

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

Delete all autosaves of a certain scenario from the default save directory.

This is only expected to be called when the player starts the next scenario (or finishes the campaign, in the case of the last scenario), so it's expected to correspond to the next scenario being written to the default save directory.

Definition at line 63 of file savegame.cpp.

References _(), savegame::save_index_class::default_saves_dir(), label, and LOG_SAVE.

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

◆ convert_old_saves()

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

converts saves from older versions of wesnoth

Definition at line 865 of file savegame.cpp.

References convert_old_saves_1_11_0(), convert_old_saves_1_13_0(), convert_old_saves_1_13_1(), convert_old_saves_1_15_3(), 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)
static

◆ convert_old_saves_1_13_0()

static void savegame::convert_old_saves_1_13_0 ( config cfg)
static

◆ convert_old_saves_1_13_1()

static void savegame::convert_old_saves_1_13_1 ( config cfg)
static

◆ convert_old_saves_1_15_3()

static void savegame::convert_old_saves_1_15_3 ( config cfg)
static

Definition at line 854 of file savegame.cpp.

References config::child_or_empty().

Referenced by convert_old_saves().

◆ 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 &  dir,
const std::string &  name,
const std::vector< std::string > &  suffixes 
)
static

Definition at line 295 of file save_index.cpp.

References filesystem::istream_file(), and LOG_SAVE.

Referenced by read_save_file().

◆ read_save_file()

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

◆ save_game_exists()

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

Returns true if there is already a savegame with this name, looking only in the default save directory.

Only expected to be used to check whether a subsequent save would overwrite an existing file, therefore only expected to be used for the default save dir.

Definition at line 56 of file savegame.cpp.

References savegame::save_index_class::default_saves_dir(), filesystem::file_exists(), and compression::format_extension().

Referenced by savegame::savegame::check_overwrite(), and foreach_autosave().