ScummVM API documentation
rnca_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 DREAMWEB_RNCA_ARCHIVE_H
23
#define DREAMWEB_RNCA_ARCHIVE_H
24
25
#include "common/archive.h"
26
#include "common/ptr.h"
27
#include "common/stream.h"
28
#include "common/hashmap.h"
29
#include "common/hash-str.h"
30
31
namespace
DreamWeb
{
32
class
RNCAArchive
:
public
Common::MemcachingCaseInsensitiveArchive
{
33
public
:
34
bool
hasFile
(
const
Common::Path
&path)
const override
;
35
int
listMembers
(
Common::ArchiveMemberList
&)
const override
;
36
const
Common::ArchiveMemberPtr
getMember
(
const
Common::Path
&path)
const override
;
37
Common::SharedArchiveContents
readContentsForPath(
const
Common::Path
&translated)
const override
;
38
39
static
RNCAArchive
* open(
Common::SeekableReadStream
*stream, DisposeAfterUse::Flag dispose = DisposeAfterUse::NO);
40
41
private
:
42
class
RNCAFileDescriptor {
43
private
:
44
Common::String
_fileName;
45
46
// Offset of the file contents relative to the beginning of RNCA stream
47
uint32 _fileDataOffset;
48
49
RNCAFileDescriptor(
const
Common::String
& filename, uint32 off) : _fileName(filename), _fileDataOffset(off) {}
50
friend
class
RNCAArchive
;
51
public
:
52
// It's public for hashmap
53
RNCAFileDescriptor() : _fileDataOffset(0) {}
54
};
55
56
typedef
Common::HashMap<Common::Path, RNCAFileDescriptor, Common::Path::IgnoreCase_Hash, Common::Path::IgnoreCase_EqualTo>
FileMap
;
57
58
RNCAArchive
(FileMap files,
Common::SeekableReadStream
*stream, DisposeAfterUse::Flag dispose)
59
: _files(files), _stream(stream, dispose) {
60
}
61
62
FileMap _files;
63
Common::DisposablePtr<Common::SeekableReadStream>
_stream;
64
};
65
}
66
#endif
Common::String
Definition:
str.h:59
Common::List
Definition:
list.h:44
Common::Path
Definition:
path.h:52
DreamWeb::RNCAArchive
Definition:
rnca_archive.h:32
Common::SeekableReadStream
Definition:
stream.h:745
DreamWeb::RNCAArchive::listMembers
int listMembers(Common::ArchiveMemberList &) const override
DreamWeb
Definition:
console.h:27
Common::HashMap< Common::Path, RNCAFileDescriptor, Common::Path::IgnoreCase_Hash, Common::Path::IgnoreCase_EqualTo >
DreamWeb::RNCAArchive::getMember
const Common::ArchiveMemberPtr getMember(const Common::Path &path) const override
Common::SharedPtr< ArchiveMember >
Common::DisposablePtr< Common::SeekableReadStream >
Common::SharedArchiveContents
Definition:
archive.h:224
Common::MemcachingCaseInsensitiveArchive
Definition:
archive.h:269
DreamWeb::RNCAArchive::hasFile
bool hasFile(const Common::Path &path) const override
engines
dreamweb
rnca_archive.h
Generated on Tue Dec 3 2024 09:14:12 for ScummVM API documentation by
1.8.13