ScummVM API documentation
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_ARCHIVE_H
23#define ULTIMA8_FILESYS_ARCHIVE_H
24
25#include "common/array.h"
26#include "common/scummsys.h"
27
28namespace Common {
29 class SeekableReadStream;
30}
31
32namespace Ultima {
33namespace Ultima8 {
34
35class FlexFile;
36
37class Archive {
38public:
41
45
46 virtual ~Archive();
47
53
56
58 void cache();
59
61 virtual void cache(uint32 index) = 0;
62
66 void uncache();
67
70 virtual void uncache(uint32 index) = 0;
71
73 virtual bool isCached(uint32 index) const = 0;
74
75 uint32 getCount() const {
76 return _count;
77 }
78
79protected:
80 uint32 _count;
81
82 uint8 *getRawObject(uint32 index, uint32 *sizep = 0);
83 uint32 getRawSize(uint32 index) const;
84
85private:
87
88 FlexFile *findArchiveFile(uint32 index) const;
89};
90
91} // End of namespace Ultima8
92} // End of namespace Ultima
93
94#endif
Definition: array.h:52
Definition: stream.h:745
Definition: archive.h:37
bool addSource(FlexFile *af)
virtual void cache(uint32 index)=0
Cache a single object.
bool addSource(Common::SeekableReadStream *rs)
add input source, autodetecting the type (as the constructor)
Archive()
create Archive without any input sources
virtual bool isCached(uint32 index) const =0
Check if an object is cached.
virtual void uncache(uint32 index)=0
Archive(Common::SeekableReadStream *rs)
void cache()
Cache all objects.
Definition: flex_file.h:28
Definition: algorithm.h:29