Doomseeker
Wadseeker
Download
Tracker
Git
Docs
Main Page
Plugin API
Related Pages
Modules
Classes
Files
File List
File Members
src
core
modreader.h
1
//------------------------------------------------------------------------------
2
// modreader.h
3
//------------------------------------------------------------------------------
4
//
5
// This library is free software; you can redistribute it and/or
6
// modify it under the terms of the GNU Lesser General Public
7
// License as published by the Free Software Foundation; either
8
// version 2.1 of the License, or (at your option) any later version.
9
//
10
// This library is distributed in the hope that it will be useful,
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
// Lesser General Public License for more details.
14
//
15
// You should have received a copy of the GNU Lesser General Public
16
// License along with this library; if not, write to the Free Software
17
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18
// 02110-1301 USA
19
//
20
//------------------------------------------------------------------------------
21
// Copyright (C) 2019 Pol Marcet Sardà <polmarcetsarda@gmail.com>
22
//------------------------------------------------------------------------------
23
#ifndef __MODREADER_H_
24
#define __MODREADER_H_
25
26
#include "dptr.h"
27
28
#include <QSharedPointer>
29
#include <QString>
30
38
struct
DirectoryEntry
39
{
40
QString name;
41
int
position;
42
int
size;
43
};
44
45
class
ModReader
46
{
47
public
:
48
virtual
~
ModReader
() {}
49
virtual
bool
load() = 0;
50
virtual
QStringList getAllMaps() = 0;
51
virtual
bool
isIwad() = 0;
52
static
QSharedPointer<ModReader> create(
const
QString &path);
53
};
54
58
class
WadReader
:
public
ModReader
59
{
60
public
:
66
WadReader
(
const
QString &path);
67
~
WadReader
()
override
;
73
bool
load()
override
;
77
bool
isIwad()
override
;
81
QList<DirectoryEntry> getDirectory();
87
QStringList getAllMaps()
override
;
88
89
private
:
93
QStringList getClassicMaps(
const
QStringList &names);
97
QStringList getUdmfMaps(
const
QStringList &names);
98
99
private
:
100
DPtr<WadReader>
d;
101
};
102
107
class
CompressedReader
:
public
ModReader
108
{
109
public
:
115
CompressedReader
(
const
QString &path);
116
~
CompressedReader
()
override
;
122
bool
load()
override
;
126
bool
isIwad
()
override
127
{
128
return
false
;
129
}
135
QStringList getAllMaps()
override
;
136
protected
:
137
QStringList getAllMapsRootDir();
138
DPtr<CompressedReader>
d;
139
};
140
144
class
PkReader
:
public
CompressedReader
145
{
146
public
:
147
PkReader
(
const
QString &path);
153
QStringList getAllMaps()
override
;
154
};
155
156
#endif
PkReader
File reader for PK3/7 format.
Definition:
modreader.h:144
WadReader
File reader for the WAD format.
Definition:
modreader.h:58
CompressedReader::isIwad
bool isIwad() override
returns whether or not this is a IWAD. It will always be false.
Definition:
modreader.h:126
DirectoryEntry
Contains an entry of a WAD directory.
Definition:
modreader.h:38
CompressedReader
File reader for generic compression file formats. Current formats: ZIP, 7Z.
Definition:
modreader.h:107
ModReader
Definition:
modreader.h:45
DPtr< WadReader >
Doomseeker © 2009-2023 The Doomseeker Team