ScummVM API documentation
savegame.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 ULTIMA8_FILESYS_SAVEGAME_H
23#define ULTIMA8_FILESYS_SAVEGAME_H
24
25#include "common/memstream.h"
26#include "common/str.h"
27#include "common/stream.h"
28#include "engines/metaengine.h"
29
30namespace Ultima {
31namespace Ultima8 {
32
33class ZipFile;
34class IDataSource;
35
37private:
39 Common::Archive *_archive;
40 uint32 _version;
41public:
42 explicit SavegameReader(Common::SeekableReadStream *rs, bool metadataOnly = false);
44
45 enum State { SAVE_CORRUPT, SAVE_VALID, SAVE_OUT_OF_DATE, SAVE_TOO_RECENT };
46 State isValid() const;
47
48 uint32 getVersion() const { return _version; }
49
50 Common::String getDescription() const { return _header.description; }
51
56};
57
59 class FileEntry : public Common::Array<byte> {
60 public:
61 Common::String _name;
62 FileEntry() : Common::Array<byte>() {}
63 };
64private:
67public:
69 virtual ~SavegameWriter();
70
75 bool writeFile(const Common::String &name, const uint8 *data, uint32 size);
76
81
83 bool finish();
84};
85
86} // End of namespace Ultima8
87} // End of namespace Ultima
88
89#endif
Definition: archive.h:141
Definition: array.h:52
Definition: memstream.h:194
Definition: path.h:52
Definition: stream.h:745
Definition: str.h:59
Definition: stream.h:77
Definition: savegame.h:36
Common::SeekableReadStream * getDataSource(const Common::Path &name)
Definition: savegame.h:58
bool writeFile(const Common::String &name, const uint8 *data, uint32 size)
bool finish()
finish savegame
bool writeFile(const Common::String &name, Common::MemoryWriteStreamDynamic *buf)
Definition: metaengine.h:94
Common::String description
Definition: metaengine.h:98