ScummVM API documentation
parser.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 DGDS_PARSER_H
23#define DGDS_PARSER_H
24
25#include "common/hashmap.h"
26#include "common/str.h"
27#include "common/stream.h"
28
29namespace Dgds {
30
31class DgdsChunkReader;
32class ResourceManager;
33class Decompressor;
34
35class ParserData {};
36
38public:
39 // FIXME: Make these private/protected
40 uint32 _bytesRead;
41 //Common::SeekableReadStream *_file;
42
43public:
44 DgdsParser(ResourceManager *resman, Decompressor *decompressor);
45 virtual ~DgdsParser() {};
46 bool parse(ParserData *data, const Common::String &filename);
47 virtual bool handleChunk(DgdsChunkReader &chunk, ParserData *data) { return false; };
48
50
51protected:
52 Common::String _filename;
53
54private:
55 ResourceManager *_resman;
56 Decompressor *_decompressor;
57};
58
59class TTMParser : public DgdsParser {
60public:
61 TTMParser(ResourceManager *resman, Decompressor *decompressor) : DgdsParser(resman, decompressor) {}
62
63private:
64 bool handleChunk(DgdsChunkReader &chunk, ParserData *data) override;
65};
66
67class ADSParser : public DgdsParser {
68public:
69 ADSParser(ResourceManager *resman, Decompressor *decompressor) : DgdsParser(resman, decompressor) {}
70
71private:
72 bool handleChunk(DgdsChunkReader &chunk, ParserData *data) override;
73};
74
75} // End of namespace Dgds
76
77#endif // DGDS_RESOURCE_H
Definition: stream.h:745
Definition: str.h:59
Definition: parser.h:67
Definition: decompress.h:67
Definition: resource.h:64
Definition: parser.h:37
Definition: parser.h:35
Definition: resource.h:48
Definition: parser.h:59