ScummVM API documentation
lab.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 GRIM_LAB_H
23 #define GRIM_LAB_H
24 
25 #include "common/archive.h"
26 
27 namespace Common {
28  class File;
29 }
30 
31 namespace Grim {
32 
33 class Lab;
34 
36  Lab *_parent;
37  Common::Path _name;
38  uint32 _offset, _len;
39 public:
40  LabEntry(const Common::Path &name, uint32 offset, uint32 len, Lab *parent);
41  Common::String getName() const override { return _name.baseName(); }
42  Common::String getFileName() const override { return _name.baseName(); }
43  Common::Path getPathInArchive() const override { return _name; }
44  Common::SeekableReadStream *createReadStream() const override;
45  Common::SeekableReadStream *createReadStreamForAltStream(Common::AltStreamType altStreamType) const override { return nullptr; }
46  friend class Lab;
47 };
48 
49 class Lab : public Common::Archive {
50 public:
51  bool open(const Common::Path &filename, bool keepStream = false);
52  Lab();
53  ~Lab();
54  // Common::Archive implementation
55  bool hasFile(const Common::Path &path) const override;
56  int listMembers(Common::ArchiveMemberList &list) const override;
57  const Common::ArchiveMemberPtr getMember(const Common::Path &path) const override;
58  Common::SeekableReadStream *createReadStreamForMember(const Common::Path &path) const override;
59 
60 private:
61  void parseGrimFileTable(Common::File *_f);
62  void parseMonkey4FileTable(Common::File *_f);
63 
64  Common::Path _labFileName;
67  LabMap _entries;
69 };
70 
71 } // end of namespace Grim
72 
73 #endif
Definition: str.h:59
Common::SeekableReadStream * createReadStreamForAltStream(Common::AltStreamType altStreamType) const override
Definition: lab.h:45
Definition: list.h:44
Common::Path getPathInArchive() const override
Definition: lab.h:43
Definition: path.h:52
Definition: stream.h:745
Definition: actor.h:33
Definition: archive.h:141
Definition: anim.h:33
Definition: file.h:47
Definition: lab.h:35
Definition: archive.h:68
Definition: algorithm.h:29
String baseName() const
Common::String getFileName() const override
Definition: lab.h:42
Common::String getName() const override
Definition: lab.h:41