ScummVM API documentation
savemetadata.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef STARK_SAVE_METADATA_H
23 #define STARK_SAVE_METADATA_H
24 
25 #include "common/error.h"
26 #include "common/system.h"
27 
28 namespace Stark {
29 
30 class ResourceSerializer;
31 
38 class SaveMetadata {
39 public:
40  Common::String description;
41  uint levelIndex;
42  uint locationIndex;
43  uint version;
44  uint32 totalPlayTime;
45 
46  uint8 saveDay;
47  uint8 saveMonth;
48  uint16 saveYear;
49 
50  uint8 saveHour;
51  uint8 saveMinute;
52  uint8 saveSecond;
53 
54  bool isAutoSave;
55 
56  const Graphics::Surface *gameWindowThumbnail;
57 
58  SaveMetadata();
59 
61  void setSaveTime(const TimeDate &timeDate);
62 
69 
71  void write(Common::WriteStream *stream);
72 
75 
78 
81 
82 private:
83  void saveLoad(ResourceSerializer *s);
84  static void syncResourceIndexAsString(ResourceSerializer *s, uint &index);
85  Common::ErrorCode syncVersion(ResourceSerializer *s);
86 
87  Common::String _readFilename;
88  Common::ErrorCode _readErrorCode;
89 };
90 
91 } // End of namespace Stark
92 
93 #endif // STARK_SAVE_METADATA_H
Definition: system.h:106
Definition: str.h:59
Definition: surface.h:67
Definition: stream.h:77
Common::ErrorCode read(Common::SeekableReadStream *stream, const Common::String &filename)
void setSaveTime(const TimeDate &timeDate)
ErrorCode
Definition: error.h:47
Definition: stream.h:745
Graphics::Surface * readGameScreenThumbnail(Common::SeekableReadStream *stream)
void skipGameScreenThumbnail(Common::SeekableReadStream *stream)
Definition: savemetadata.h:38
void write(Common::WriteStream *stream)
Definition: console.h:27
void writeGameScreenThumbnail(Common::WriteStream *stream)
Definition: stateprovider.h:51