1 /* GemRB - Infinity Engine Emulator 2 * Copyright (C) 2003 The GemRB Project 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 2 7 * of the License, or (at your option) any later version. 8 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 * 18 * 19 */ 20 21 #ifndef SAVEGAMEITERATOR_H 22 #define SAVEGAMEITERATOR_H 23 24 #include "exports.h" 25 26 #include "SaveGame.h" 27 28 #include <vector> 29 30 namespace GemRB { 31 32 #define SAVEGAME_DIRECTORY_MATCHER "%d - %[A-Za-z0-9- _+*#%&|()=!?':;]" 33 34 class GEM_EXPORT SaveGameIterator { 35 private: 36 typedef std::vector<Holder<SaveGame> > charlist; 37 charlist save_slots; 38 39 public: 40 SaveGameIterator(void); 41 ~SaveGameIterator(void); 42 const charlist& GetSaveGames(); 43 void DeleteSaveGame(Holder<SaveGame>); 44 int CreateSaveGame(Holder<SaveGame>, const char *slotname); 45 int CreateSaveGame(int index, bool mqs = false); 46 Holder<SaveGame> GetSaveGame(const char *slotname); 47 private: 48 bool RescanSaveGames(); 49 static Holder<SaveGame> BuildSaveGame(const char *slotname); 50 void PruneQuickSave(const char *folder); 51 }; 52 53 } 54 55 #endif 56