ScummVM API documentation
container.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/*
23 * Based on
24 * WebVenture (c) 2010, Sean Kasun
25 * https://github.com/mrkite/webventure, http://seancode.com/webventure/
26 *
27 * Used with explicit permission from the author
28 */
29
30#ifndef MACVENTURE_CONTAINER_H
31#define MACVENTURE_CONTAINER_H
32
33#include "macventure/macventure.h"
34
35#include "common/file.h"
36#include "common/fs.h"
37
38namespace MacVenture {
39
40struct ItemGroup {
41 uint32 bitOffset; //It's really uint24
42 uint32 offset; //It's really uint24
43 uint32 lengths[64];
44};
45
46typedef uint32 ContainerHeader;
47
48class Container {
49
50public:
51 Container(const Common::Path &filename);
52 ~Container();
53
54public:
58 uint32 getItemByteSize(uint32 id);
59
64
65protected:
66
67 bool _simplified;
68
69 uint _lenObjs; // In the case of simple container, length of an object
70 uint _numObjs;
71
72 ContainerHeader _header;
73
74 Common::Array<uint16> _huff; // huffman masks
75 Common::Array<uint8> _lens; // huffman lengths
77
78 Common::Path _filename;
79 Common::File _file;
81
82};
83
84
85} // End of namespace MacVenture
86
87#endif
Definition: file.h:47
Definition: path.h:52
Definition: stream.h:745
Definition: container.h:48
Common::SeekableReadStream * getItem(uint32 id)
uint32 getItemByteSize(uint32 id)
Definition: container.h:40