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
27
#include "ultima/shared/std/containers.h"
28
#include "ultima/shared/std/string.h"
29
30
namespace
Ultima
{
31
namespace
Ultima8 {
32
33
class
U8SaveFile
:
public
Common::Archive
{
34
public
:
37
explicit
U8SaveFile
(
Common::SeekableReadStream
*rs);
38
~
U8SaveFile
()
override
;
39
41
bool
isValid
()
const
{
42
return
_valid;
43
}
44
45
// Common::Archive API implementation
46
bool
hasFile
(
const
Common::Path
&path)
const override
;
47
int
listMembers
(
Common::ArchiveMemberList
&list)
const override
;
48
const
Common::ArchiveMemberPtr
getMember
(
const
Common::Path
&path)
const override
;
49
Common::SeekableReadStream
*
createReadStreamForMember
(
const
Common::Path
&path)
const override
;
50
51
static
bool
isU8SaveFile(
Common::SeekableReadStream
*rs);
52
53
protected
:
54
Common::SeekableReadStream
*_rs;
55
bool
_valid;
56
57
struct
FileEntry
{
58
uint32 _offset;
59
uint32 _size;
60
FileEntry
() : _offset(0), _size(0) {}
61
};
62
63
typedef
Common::HashMap<Common::String, FileEntry, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo>
U8SaveFileMap
;
64
U8SaveFileMap _map;
65
66
private
:
67
bool
readMetadata();
68
};
69
70
}
// End of namespace Ultima8
71
}
// End of namespace Ultima
72
73
#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:41
Ultima::Ultima8::U8SaveFile::FileEntry
Definition:
u8_save_file.h:57
Ultima::Ultima8::U8SaveFile::createReadStreamForMember
Common::SeekableReadStream * createReadStreamForMember(const Common::Path &path) const override
Common::SharedPtr< ArchiveMember >
Ultima::Ultima8::U8SaveFile
Definition:
u8_save_file.h:33
Ultima::Ultima8::U8SaveFile::getMember
const Common::ArchiveMemberPtr getMember(const Common::Path &path) const override
engines
ultima
ultima8
filesys
u8_save_file.h
Generated on Sat Nov 23 2024 09:21:40 for ScummVM API documentation by
1.8.13