23 #ifndef TEENAGENT_PACK_H 24 #define TEENAGENT_PACK_H 26 #include "common/file.h" 27 #include "common/array.h" 35 Pack(): _fileCount(0) {}
38 virtual void close() = 0;
40 virtual uint32 fileCount()
const {
return _fileCount; }
41 virtual uint32 getSize(uint32
id)
const = 0;
42 virtual uint32 read(uint32
id, byte *dst, uint32 size)
const = 0;
56 void close()
override;
58 uint32 getSize(uint32
id)
const override;
59 uint32 read(uint32
id, byte *dst, uint32 size)
const override;
75 void close()
override;
77 uint32 getSize(uint32
id)
const override;
78 uint32 read(uint32
id, byte *dst, uint32 size)
const override;
87 inline Chunk(): data(0), size(0) {}
88 inline Chunk(
const Chunk &c) : data(c.data), size(c.size) { c.reset(); }
89 inline Chunk &operator=(
const Chunk &c) {
95 inline ~Chunk() {
delete[] data; }
96 inline void reset()
const {
97 Chunk *c =
const_cast<Chunk *
>(
this);
106 void close()
override;
108 uint32 getSize(uint32
id)
const override;
109 uint32 read(uint32
id, byte *dst, uint32 size)
const override;
MemoryPack loads whole pack in memory, currently unused.
Definition: pack.h:83
FilePack keeps opened file and returns substream for each request.
Definition: pack.h:47