ScummVM API documentation
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
cc_archive.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 MM_SHARED_XEEN_CC_ARCHIVE_H
23
#define MM_SHARED_XEEN_CC_ARCHIVE_H
24
25
#include "common/archive.h"
26
#include "common/stream.h"
27
28
namespace
MM
{
29
namespace
Shared {
30
namespace
Xeen {
31
35
struct
CCEntry
{
36
uint16 _id;
37
int
_offset;
38
uint16 _size;
39
int
_writeOffset;
40
41
CCEntry
() : _id(0), _offset(0), _size(0), _writeOffset(0) {
42
}
43
CCEntry
(uint16
id
, uint32 offset, uint32 size)
44
: _id(
id
), _offset(offset), _size(size) {
45
}
46
};
47
51
class
BaseCCArchive
:
public
Common::Archive
{
52
protected
:
53
Common::Array<CCEntry>
_index;
54
58
void
loadIndex(
Common::SeekableReadStream
&stream);
59
63
void
saveIndex(
Common::WriteStream
&stream);
64
69
virtual
bool
getHeaderEntry(
const
Common::Path
&resourceName,
CCEntry
&ccEntry)
const
;
70
75
virtual
bool
getHeaderEntry(uint16
id
,
CCEntry
&ccEntry)
const
;
76
public
:
80
static
uint16 convertNameToId(
const
Common::Path
&resourceName);
81
public
:
82
BaseCCArchive
() {
83
}
84
85
// Archive implementation
86
bool
hasFile(
const
Common::Path
&path)
const override
;
87
int
listMembers(
Common::ArchiveMemberList
&list)
const override
;
88
const
Common::ArchiveMemberPtr
getMember(
const
Common::Path
&path)
const override
;
89
};
90
94
class
CCArchive
:
public
BaseCCArchive
{
95
private
:
96
Common::Path
_filename;
97
Common::String
_prefix;
98
bool
_encoded;
99
protected
:
100
bool
getHeaderEntry(
const
Common::Path
&resourceName,
CCEntry
&ccEntry)
const override
;
101
public
:
102
CCArchive
(
const
Common::Path
&filename,
bool
encoded);
103
CCArchive
(
const
Common::Path
&filename,
const
Common::String
&prefix,
bool
encoded);
104
~
CCArchive
()
override
;
105
106
// Archive implementation
107
Common::SeekableReadStream
*createReadStreamForMember(
const
Common::Path
&path)
const override
;
108
};
109
110
}
// namespace Xeen
111
}
// namespace Shared
112
}
// namespace MM
113
114
#endif
Common::String
Definition:
str.h:59
Common::WriteStream
Definition:
stream.h:77
Common::Array
Definition:
array.h:52
Common::List
Definition:
list.h:44
Common::Path
Definition:
path.h:52
Common::SeekableReadStream
Definition:
stream.h:745
Common::Archive
Definition:
archive.h:141
MM::Shared::Xeen::CCEntry
Definition:
cc_archive.h:35
MM
Definition:
detection.h:27
MM::Shared::Xeen::BaseCCArchive
Definition:
cc_archive.h:51
Common::SharedPtr< ArchiveMember >
MM::Shared::Xeen::CCArchive
Definition:
cc_archive.h:94
engines
mm
shared
xeen
cc_archive.h
Generated on Wed Apr 9 2025 09:17:06 for ScummVM API documentation by
1.8.13