ScummVM API documentation
disk.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 LURE_DISK_H
23 #define LURE_DISK_H
24 
25 
26 #include "common/scummsys.h"
27 #include "common/str.h"
28 #include "lure/memory.h"
29 #include "lure/res_struct.h"
30 
31 namespace Common {
32 class File;
33 }
34 
35 namespace Lure {
36 
37 #define NUM_ENTRIES_IN_HEADER 0xBF
38 #define HEADER_IDENT_STRING "heywow"
39 #define SUPPORT_IDENT_STRING "lure"
40 #define HEADER_ENTRY_UNUSED_ID 0xffff
41 
42 class Disk {
43 private:
44  uint8 _fileNum;
45  uint32 _dataOffset;
46  Common::File *_fileHandle;
47  FileEntry _entries[NUM_ENTRIES_IN_HEADER];
48 
49  uint8 indexOf(uint16 id, bool suppressError = false);
50 public:
51  Disk();
52  ~Disk();
53  static Disk &getReference();
54 
55  void openFile(uint8 fileNum);
56  uint32 getEntrySize(uint16 id);
57  MemoryBlock *getEntry(uint16 id);
58  bool exists(uint16 id);
59 
60  uint8 numEntries();
61  FileEntry *getIndex(uint8 entryIndex);
62 };
63 
64 } // End of namespace Lure
65 
66 #endif
Definition: disk.h:42
Definition: file.h:47
Definition: algorithm.h:29
Definition: res_struct.h:60
Definition: animseq.h:27
Definition: memory.h:31