ScummVM API documentation
iff.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 NANCY_IFF_H
23 #define NANCY_IFF_H
24 
25 #include "common/array.h"
26 
27 namespace Common {
28 struct IFFChunk;
29 class SeekableReadStream;
30 }
31 
32 namespace Nancy {
33 
34 class NancyEngine;
35 class ResourceManager;
36 
37 class IFF {
38  friend class ResourceManager;
39 private:
41 
42 public:
43  ~IFF();
44 
45  const byte *getChunk(uint32 id, uint &size, uint index = 0) const;
46  Common::SeekableReadStream *getChunkStream(const Common::String &id, uint index = 0) const;
47 
48  void list(Common::Array<Common::String> &nameList) const;
49 
50 private:
51  static Common::String idToString(uint32 id);
52  static uint32 stringToId(const Common::String &s);
53 
54  bool callback(Common::IFFChunk &chunk);
55 
56  struct Chunk {
57  uint32 id;
58  byte *buf;
59  uint32 size;
60  };
61 
62  const Common::SeekableReadStream *_stream;
63  Common::Array<Chunk> _chunks;
64  uint32 _nextDATAChunk;
65 };
66 
67 } // End of namespace Nancy
68 
69 #endif // NANCY_IFF_H
Definition: str.h:59
Definition: stream.h:745
Definition: algorithm.h:29
Definition: resource.h:36
Definition: iff.h:37
Definition: iff_container.h:160
Definition: actionmanager.h:32