Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Refactoring of save_index.
- New class savegame::save_index_class with instance save_index_manager:
- Methods:
- * data() - old save_index::load() - load save_index from disk if doesn't
- loaded yet
- * data(const std::string& name) - get (or create if not available) summary
- from save_index (from data())
- * write_save_index() - write current save_index to disk
- * rebuild(const std::string& name, const time_t& modified) - re-load summary
- from savefile, update summary, write updated index to disk
- * rebuild(const std::string& name) - rebuild where modified == file
- modification time
- * set_modified(const std::string& name) - remember modified time of file
- * get(const std::string& name) - check data(name)["mod_time"] - if different
- from remembered by "set_modified" - rebuild
- Class savegame::save_info changed
- * time_t and std::string members now private. You should use method
- for access to it
- * summary() method for transparent access to summary
- (save_index_manager.get(name()) - see save_index_manager.get description
- above)
- Class savegame::manager removed. All statis function moved to savegame
- namespace.
- Function "savegame::extract_summary_data_from_save" removed, because it
- word-by-word equalient to "extract_summary_from_config". I just call "rebuild"
- for save_info in "finish_save_game". My purpose was avoid copy-paste.
- Other changes:
- * I removed summaries from src/dialogs.cpp. Now you can transparent access by
- save_info::summary()
- * I removed all copy-paste like (use summary() instead of this):
- --------------------------------------------------
- std::string dummy;
- const config &summary = *summaries_[index_];
- if (summary["label"].empty())
- {
- try {
- savegame::manager::load_summary((*info_)[index_].name, *summaries_[index_],
- &dummy);
- } catch(game::load_game_failed&) {
- (*summaries_[index_])["corrupt"] = true;
- }
- }
- --------------------------------------------------
- * added class filename_filter - predicate for erase (used in get_saves_list)
- * added class create_save_info - builder for save_info. In general you can't
- create save_info right now (and this is unecessary). If you need this in
- feature - just move declaration of class create_save_info to header.
Advertisement
Add Comment
Please, Sign In to add comment