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