60 void checkZzipError(
int zzipError,
const String& operation)
const;
83 void remove(
const String& filename)
const;
100 bool exists(
const String& filename);
103 time_t getModifiedTime(
const String& filename);
112 const String& getType(
void)
const;
124 template <
size_t cacheSize>
148 assert(
avail() == 0 &&
"It is assumed that you cache data only after you have read everything.");
150 if (count < cacheSize)
165 memcpy(
mBuffer + cacheSize - count, buf, count);
174 memcpy(
mBuffer, (
const char*)buf + count - cacheSize, cacheSize);
180 size_t read(
void* buf,
size_t count)
183 rb = (rb < count) ? rb : count;
204 bool ff(
size_t count)
266 size_t read(
void* buf,
size_t count);
268 size_t write(
void* buf,
size_t count);
270 void skip(
long count);
272 void seek(
size_t pos );
274 size_t tell(
void)
const;
276 bool eof(
void)
const;
ZZIP_DIR * mZzipDir
Handle to root zip file.
char mBuffer[cacheSize]
Static buffer.
Archive * createInstance(const String &name)
Creates a new object.
size_t cacheData(const void *buf, size_t count)
Cache data pointed by 'buf'.
Template version of cache based on static array.
bool rewind(size_t count)
Step back in cached stream by 'count' bytes.
size_t avail() const
Returns number of bytes available for reading in cache after rewinding.
Specialisation of the Archive class to allow reading of files from a zip format source archive...
void clear()
Clear the cache.
Specialisation of ArchiveFactory for Zip files.
Abstract factory class, archive codec plugins can register concrete subclasses of this...
FileInfoList mFileList
File list (since zziplib seems to only allow scanning of dir tree once)
struct zzip_file ZZIP_FILE
vector< FileInfo >::type FileInfoList
bool ff(size_t count)
Step forward in cached stream by 'count' bytes.
size_t read(void *buf, size_t count)
Read data from cache to 'buf' (maximum 'count' bytes).
General purpose class used for encapsulating the reading and writing of data.
Dummy version of cache to test no caching.
void destroyInstance(Archive *arch)
Destroys an object which was created by this factory.
StaticCache< 2 *OGRE_STREAM_TEMP_SIZE > mCache
We need caching because sometimes serializers step back in data stream and zziplib behaves slow...
virtual ~ZipArchiveFactory()
bool isCaseSensitive(void) const
Returns whether this archive is case sensitive in the way it matches files.
StaticCache()
Constructor.
size_t mValidBytes
Number of bytes valid in cache (written from the beginning of static buffer)
size_t mPos
Current read position.