ScummVM API documentation
resource.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 GROOVIE_RESOURCE_H
23 #define GROOVIE_RESOURCE_H
24 
25 namespace Common {
26 class MacResManager;
27 }
28 
29 namespace Groovie {
30 
31 struct ResInfo {
32  uint32 disks; // This seems to be a bitfield indicating on which disk(s) the file is located.
33  uint16 gjd;
34  uint32 offset;
35  uint32 size;
36  Common::String filename;
37 };
38 
39 class ResMan {
40 public:
41  virtual ~ResMan() {}
42 
43  Common::SeekableReadStream *open(uint32 fileRef);
44  Common::SeekableReadStream *open(const ResInfo &resInfo);
45 
46  void dumpResource(const Common::String &fileName);
47  void dumpResource(uint32 fileRef, const Common::Path &fileName);
48  void dumpResource(Common::SeekableReadStream *inFile, const Common::Path &fileName, bool dispose = true);
49 
50  Common::String getGjdName(const ResInfo &resInfo);
51  virtual uint32 getRef(Common::String name) = 0;
52  virtual bool getResInfo(uint32 fileRef, ResInfo &resInfo) = 0;
53 
54 protected:
56 
57  uint16 _lastGjd;
58 };
59 
60 class ResMan_t7g : public ResMan {
61 public:
62  ResMan_t7g(Common::MacResManager *macResFork = 0);
63  ~ResMan_t7g() override {}
64 
65  uint32 getRef(Common::String name) override;
66  bool getResInfo(uint32 fileRef, ResInfo &resInfo) override;
67 
68 private:
69  Common::MacResManager *_macResFork;
70 };
71 
72 class ResMan_v2 : public ResMan {
73 public:
74  ResMan_v2();
75  ~ResMan_v2() override {}
76 
77  uint32 getRef(Common::String name) override;
78  bool getResInfo(uint32 fileRef, ResInfo &resInfo) override;
79 };
80 
81 } // End of Groovie namespace
82 
83 #endif // GROOVIE_RESOURCE_H
Definition: macresman.h:125
Definition: str.h:59
Definition: resource.h:39
Definition: path.h:52
Definition: stream.h:745
Definition: resource.h:60
Definition: algorithm.h:29
Definition: resource.h:31
Definition: resource.h:72
Definition: cursor.h:32