ScummVM API documentation
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
res_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 GOT_UTILS_RES_ARCHIVE_H
23
#define GOT_UTILS_RES_ARCHIVE_H
24
25
#include "common/archive.h"
26
#include "common/stream.h"
27
28
namespace
Got
{
29
30
struct
ResHeader
{
31
Common::String
_name;
32
uint32 _offset = 0;
33
uint32 _size = 0;
34
uint32 _originalSize = 0;
35
int
_key = 0;
36
37
void
load(
Common::SeekableReadStream
*src);
38
};
39
40
#define RES_MAX_ENTRIES 256 // Max # of elements
41
#define RES_HEADER_ENTRY_SIZE 23 // Size of a single header entry
42
class
ResArchive
:
public
Common::Archive
{
43
private
:
44
Common::Array<ResHeader>
_headers;
45
52
void
decrypt(byte *buf,
size_t
len, byte key)
const
;
53
57
void
lzssDecompress(
const
byte *src, byte *dest)
const
;
58
62
int
indexOf(
const
Common::String
&name)
const
;
63
64
public
:
68
ResArchive
();
69
75
bool
hasFile(
const
Common::Path
&path)
const override
;
76
83
int
listMembers(
Common::ArchiveMemberList
&list)
const override
;
84
88
const
Common::ArchiveMemberPtr
getMember(
const
Common::Path
&path)
const override
;
89
95
Common::SeekableReadStream
*createReadStreamForMember(
const
Common::Path
&path)
const override
;
96
};
97
98
extern
void
resInit();
99
100
}
// namespace Got
101
102
#endif
Common::String
Definition:
str.h:59
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
Got::ResHeader
Definition:
res_archive.h:30
Got::ResArchive
Definition:
res_archive.h:42
Got
Definition:
console.h:28
Common::SharedPtr< ArchiveMember >
engines
got
utils
res_archive.h
Generated on Thu Apr 10 2025 09:12:18 for ScummVM API documentation by
1.8.13