ScummVM API documentation
fileset.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#ifndef SLUDGE_FILESET_H
22#define SLUDGE_FILESET_H
23
24#include "common/file.h"
25
26namespace Sludge {
27
29
30public:
33
34 void init();
35 void kill();
36
37 void setData(Common::File *readStream);
38 void setFileIndices(uint, uint);
39 Common::SeekableReadStream *getData() { return _bigDataFile; }
40
41 uint openFileFromNum(int num);
42 bool openSubSlice(int num);
43 bool openObjectSlice(int num);
44 Common::String getNumberedString(int value);
45
46 // Access control flag
47 bool startAccess();
48 void finishAccess();
49
50 // Resource names
51 void readResourceNames(Common::SeekableReadStream *readStream);
52 const Common::String resourceNameFromNum(int i);
53 bool hasResourceNames() const { return !_allResourceNames.empty(); }
54 int getResourceNameCount() const { return _allResourceNames.size(); }
55
56 void dumpFile(int num, const char *pattern);
57 bool dumpFileFromName(const char *name);
58
59private:
60 bool _sliceBusy;
61 Common::File *_bigDataFile;
62 uint32 _startOfDataIndex, _startOfTextIndex, _startOfSubIndex, _startOfObjectIndex;
63 int32 _startIndex;
64
65 Common::Array<Common::String> _allResourceNames;
66
67private:
68 static uint32 _cp1250ToUTF32[128];
69 Common::String convertString(const Common::String &s);
70};
71
72} // End of namespace Sludge
73
74#endif
size_type size() const
Definition: array.h:316
bool empty() const
Definition: array.h:352
Definition: file.h:47
Definition: stream.h:745
Definition: str.h:59
Definition: fileset.h:28