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 IFF {
35 public:
37  ~IFF();
38 
39  const byte *getChunk(uint32 id, uint &size, uint index = 0) const;
40  Common::SeekableReadStream *getChunkStream(const Common::String &id, uint index = 0) const;
41 
42  void list(Common::Array<Common::String> &nameList) const;
43 
44 private:
45  static Common::String idToString(uint32 id);
46  static uint32 stringToId(const Common::String &s);
47 
48  bool callback(Common::IFFChunk &chunk);
49 
50  struct Chunk {
51  uint32 id;
52  byte *buf;
53  uint32 size;
54  };
55 
56  const Common::SeekableReadStream *_stream;
57  Common::Array<Chunk> _chunks;
58  uint32 _nextDATAChunk;
59 };
60 
61 } // End of namespace Nancy
62 
63 #endif // NANCY_IFF_H
Definition: str.h:59
Definition: stream.h:745
Definition: algorithm.h:29
Definition: iff.h:34
Definition: iff_container.h:160
Definition: actionmanager.h:32