ScummVM API documentation
raw_archive.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 ULTIMA8_FILESYS_RAWARCHIVE_H
23 #define ULTIMA8_FILESYS_RAWARCHIVE_H
24 
25 #include "ultima/ultima8/filesys/archive.h"
26 
27 namespace Ultima {
28 namespace Ultima8 {
29 
30 class ArchiveFile;
31 class IDataSource;
32 
33 class RawArchive : public Archive {
34 public:
35  RawArchive() : Archive() { }
36  explicit RawArchive(Common::SeekableReadStream *rs) : Archive(rs) { }
37 
38  ~RawArchive() override;
39 
40  void cache(uint32 index) override;
41  void uncache(uint32 index) override;
42  bool isCached(uint32 index) const override;
43 
45  virtual const uint8 *get_object_nodel(uint32 index);
46 
48  virtual uint8 *get_object(uint32 index);
49 
51  virtual uint32 get_size(uint32 index) const;
52 
55  virtual Common::SeekableReadStream *get_datasource(uint32 index);
56 
57 protected:
58  Std::vector<uint8 *> _objects;
59 };
60 
61 } // End of namespace Ultima8
62 } // End of namespace Ultima
63 
64 #endif
void cache()
Cache all objects.
Definition: raw_archive.h:33
Definition: stream.h:745
Archive()
create Archive without any input sources
virtual Common::SeekableReadStream * get_datasource(uint32 index)
Definition: detection.h:27
Definition: archive.h:30
virtual uint32 get_size(uint32 index) const
get size of object
virtual const uint8 * get_object_nodel(uint32 index)
return object. DON&#39;T delete or modify!
bool isCached(uint32 index) const override
Check if an object is cached.
virtual uint8 * get_object(uint32 index)
return object. delete afterwards. This will not cache the object
Definition: containers.h:38