OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
character.hpp
Go to the documentation of this file.
1 #ifndef GAME_STATE_CHARACTER_H
2 #define GAME_STATE_CHARACTER_H
3 
4 #include <boost/filesystem/path.hpp>
5 
7 
8 namespace MWState
9 {
10  struct Slot
11  {
12  boost::filesystem::path mPath;
14  std::time_t mTimeStamp;
15  };
16 
17  bool operator< (const Slot& left, const Slot& right);
18 
19  class Character
20  {
21  public:
22 
23  typedef std::vector<Slot>::const_reverse_iterator SlotIterator;
24 
25  private:
26 
27  boost::filesystem::path mPath;
28  std::vector<Slot> mSlots;
29 
30  void addSlot (const boost::filesystem::path& path, const std::string& game);
31 
32  void addSlot (const ESM::SavedGame& profile);
33 
34  public:
35 
36  Character (const boost::filesystem::path& saves, const std::string& game);
37 
38  void cleanup();
40 
41  const Slot *createSlot (const ESM::SavedGame& profile);
45 
49  void deleteSlot (const Slot *slot);
50 
51  const Slot *updateSlot (const Slot *slot, const ESM::SavedGame& profile);
55 
56  SlotIterator begin() const;
58 
59  SlotIterator end() const;
60 
61  const boost::filesystem::path& getPath() const;
62 
67  };
68 }
69 
70 #endif
std::vector< Slot > mSlots
Definition: character.hpp:28
const Slot * createSlot(const ESM::SavedGame &profile)
Definition: character.cpp:119
Definition: character.hpp:19
const Slot * updateSlot(const Slot *slot, const ESM::SavedGame &profile)
Definition: character.cpp:141
Definition: savedgame.hpp:14
const boost::filesystem::path & getPath() const
Definition: character.cpp:191
boost::filesystem::path mPath
Definition: character.hpp:27
void cleanup()
Delete the directory we used, if it is empty.
Definition: character.cpp:104
SlotIterator end() const
Definition: character.cpp:167
std::time_t mTimeStamp
Definition: character.hpp:14
ESM::SavedGame getSignature() const
Definition: character.cpp:172
std::vector< Slot >::const_reverse_iterator SlotIterator
Definition: character.hpp:23
ESM::SavedGame mProfile
Definition: character.hpp:13
boost::filesystem::path mPath
Definition: character.hpp:12
void deleteSlot(const Slot *slot)
Definition: character.cpp:126
void addSlot(const boost::filesystem::path &path, const std::string &game)
Definition: character.cpp:22
SlotIterator begin() const
Any call to createSlot and updateSlot can invalidate the returned iterator.
Definition: character.cpp:162
bool operator<(const Slot &left, const Slot &right)
Definition: character.cpp:16
Character(const boost::filesystem::path &saves, const std::string &game)
Definition: character.cpp:79
Definition: character.hpp:10