ScummVM API documentation
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
28namespace MM {
29namespace Shared {
30namespace Xeen {
31
35struct 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
52protected:
54
59
64
69 virtual bool getHeaderEntry(const Common::Path &resourceName, CCEntry &ccEntry) const;
70
75 virtual bool getHeaderEntry(uint16 id, CCEntry &ccEntry) const;
76public:
80 static uint16 convertNameToId(const Common::Path &resourceName);
81public:
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
94class CCArchive : public BaseCCArchive {
95private:
96 Common::Path _filename;
97 Common::String _prefix;
98 bool _encoded;
99protected:
100 bool getHeaderEntry(const Common::Path &resourceName, CCEntry &ccEntry) const override;
101public:
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
108};
109
110} // namespace Xeen
111} // namespace Shared
112} // namespace MM
113
114#endif
Definition: archive.h:141
Definition: array.h:52
Definition: list.h:44
Definition: path.h:52
Definition: stream.h:745
Definition: str.h:59
Definition: stream.h:77
Definition: cc_archive.h:51
int listMembers(Common::ArchiveMemberList &list) const override
bool hasFile(const Common::Path &path) const override
static uint16 convertNameToId(const Common::Path &resourceName)
virtual bool getHeaderEntry(uint16 id, CCEntry &ccEntry) const
const Common::ArchiveMemberPtr getMember(const Common::Path &path) const override
virtual bool getHeaderEntry(const Common::Path &resourceName, CCEntry &ccEntry) const
void loadIndex(Common::SeekableReadStream &stream)
void saveIndex(Common::WriteStream &stream)
Definition: cc_archive.h:94
Common::SeekableReadStream * createReadStreamForMember(const Common::Path &path) const override
bool getHeaderEntry(const Common::Path &resourceName, CCEntry &ccEntry) const override
Definition: detection.h:27
Definition: cc_archive.h:35