ScummVM API documentation
u8_save_file.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_U8SAVEFILE_H
23
#define ULTIMA8_FILESYS_U8SAVEFILE_H
24
25
#include "common/archive.h"
26
#include "common/str.h"
27
28
namespace
Ultima
{
29
namespace
Ultima8 {
30
31
class
U8SaveFile
:
public
Common::Archive
{
32
public
:
35
explicit
U8SaveFile
(
Common::SeekableReadStream
*rs);
36
~
U8SaveFile
()
override
;
37
39
bool
isValid
()
const
{
40
return
_valid;
41
}
42
43
// Common::Archive API implementation
44
bool
hasFile
(
const
Common::Path
&path)
const override
;
45
int
listMembers
(
Common::ArchiveMemberList
&list)
const override
;
46
const
Common::ArchiveMemberPtr
getMember
(
const
Common::Path
&path)
const override
;
47
Common::SeekableReadStream
*
createReadStreamForMember
(
const
Common::Path
&path)
const override
;
48
49
static
bool
isU8SaveFile(
Common::SeekableReadStream
*rs);
50
51
protected
:
52
Common::SeekableReadStream
*_rs;
53
bool
_valid;
54
55
struct
FileEntry
{
56
uint32 _offset;
57
uint32 _size;
58
FileEntry
() : _offset(0), _size(0) {}
59
};
60
61
typedef
Common::HashMap<Common::String, FileEntry, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo>
U8SaveFileMap
;
62
U8SaveFileMap _map;
63
64
private
:
65
bool
readMetadata();
66
};
67
68
}
// End of namespace Ultima8
69
}
// End of namespace Ultima
70
71
#endif
Ultima::Ultima8::U8SaveFile::U8SaveFile
U8SaveFile(Common::SeekableReadStream *rs)
Common::List
Definition:
list.h:44
Common::Path
Definition:
path.h:52
Common::SeekableReadStream
Definition:
stream.h:745
Ultima::Ultima8::U8SaveFile::hasFile
bool hasFile(const Common::Path &path) const override
Common::Archive
Definition:
archive.h:141
Ultima
Definition:
detection.h:27
Ultima::Ultima8::U8SaveFile::listMembers
int listMembers(Common::ArchiveMemberList &list) const override
Common::HashMap< Common::String, FileEntry, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo >
Ultima::Ultima8::U8SaveFile::isValid
bool isValid() const
Check if constructed object is indeed a valid archive.
Definition:
u8_save_file.h:39
Ultima::Ultima8::U8SaveFile::FileEntry
Definition:
u8_save_file.h:55
Ultima::Ultima8::U8SaveFile::createReadStreamForMember
Common::SeekableReadStream * createReadStreamForMember(const Common::Path &path) const override
Common::SharedPtr< ArchiveMember >
Ultima::Ultima8::U8SaveFile
Definition:
u8_save_file.h:31
Ultima::Ultima8::U8SaveFile::getMember
const Common::ArchiveMemberPtr getMember(const Common::Path &path) const override
engines
ultima
ultima8
filesys
u8_save_file.h
Generated on Mon Mar 9 2026 09:27:54 for ScummVM API documentation by
1.8.13