ScummVM API documentation
xrc.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 STARK_XRC_READER_H
23 #define STARK_XRC_READER_H
24 
25 #include "common/array.h"
26 #include "common/rect.h"
27 #include "common/str.h"
28 #include "common/substream.h"
29 #include "common/types.h"
30 
31 #include "math/vector3d.h"
32 #include "math/vector4d.h"
33 
34 #include "engines/stark/resources/object.h"
35 #include "engines/stark/resourcereference.h"
36 
37 namespace Stark {
38 namespace Formats {
39 
40 class XARCArchive;
41 
46 public:
47  XRCReadStream(const Common::Path &archiveName, Common::SeekableReadStream *parentStream, DisposeAfterUse::Flag disposeParentStream = DisposeAfterUse::YES);
48  virtual ~XRCReadStream();
49 
52 
53  Common::String readString();
54  Resources::Type readResourceType();
55  ResourceReference readResourceReference();
56  Math::Vector3d readVector3();
57  Common::Rect readRect();
58  Common::Point readPoint();
59  bool readBool();
60  bool isDataLeft();
61 
62 private:
63  Common::Path _archiveName;
64 };
65 
69 class XRCReader {
70 public:
74  static Resources::Object *importTree(XARCArchive *archive);
75 
76 protected:
77  static Resources::Object *importResource(XRCReadStream *stream, Resources::Object *parent);
78  static Resources::Object *createResource(XRCReadStream *stream, Resources::Object *parent);
79  static void importResourceChildren(XRCReadStream *stream, Resources::Object *resource);
80  static void importResourceData(XRCReadStream* stream, Resources::Object* resource);
81 };
82 
83 } // End of namespace Formats
84 } // End of namespace Stark
85 
86 #endif // STARK_XRC_READER_H
Definition: object.h:37
Definition: str.h:59
Definition: xrc.h:69
Definition: rect.h:144
Definition: path.h:52
Common::Path getArchiveName() const
Definition: stream.h:745
Definition: xarc.h:33
Definition: resourcereference.h:39
Definition: console.h:27
Definition: object.h:143
Definition: substream.h:78
Definition: rect.h:45
Definition: xrc.h:45