ScummVM API documentation
resource.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 SCUMM_EDITOR_RESOURCE_H
23 #define SCUMM_EDITOR_RESOURCE_H
24 
25 #include "common/array.h"
26 #include "common/noncopyable.h"
27 #include "common/path.h"
28 
29 namespace Scumm {
30 
31 namespace Editor {
32 
33 class File;
34 
35 struct Block {
36  uint32 offset;
37  uint32 tag;
38  uint32 size;
39  int parent;
40  Common::Array<int> children;
41 };
42 
43 class Resource : public Common::NonCopyable {
44 private:
45  int _version;
46  Common::Array<File *> _files;
48 
49  void buildBlocks(File &file, uint32 startOffset, uint32 endOffset, int parentIndex, Common::Array<Block> &blocks);
50  bool isContainerBlock(uint32 tag) const;
51 
52 public:
53  Resource(int version);
54  ~Resource();
55 
56  void addFile(const Common::Path &path, byte encByte);
57  int getFileCount() const;
58  File *getFile(int index);
59  const Common::Array<Block> &getBlocks(int index) const;
60 };
61 
62 } // End of namespace Editor
63 
64 } // End of namespace Scumm
65 
66 #endif
Definition: resource.h:43
Definition: path.h:52
Definition: noncopyable.h:39
Definition: file.h:33
Definition: actor.h:30
Definition: resource.h:35