Go to the documentation of this file.
35 #if OGRE_THREAD_SUPPORT
104 bool dirs =
false)
const;
147 return resZipArchive;
156 typedef bool (*DecryptEmbeddedZipFileFunc)(
size_t pos,
void* buf,
size_t len);
160 size_t fileSize, DecryptEmbeddedZipFileFunc decryptFunc);
181 size_t read(
void* buf,
size_t count);
183 size_t write(
void* buf,
size_t count);
void load()
Loads the archive.
EmbeddedZipArchiveFactory()
ZZIP_DIR * mZzipDir
Handle to root zip file.
DataStreamPtr create(const String &filename) const
Create a new file (or overwrite one already there).
FileInfoList mFileList
File list (since zziplib seems to only allow scanning of dir tree once)
General purpose class used for encapsulating the reading and writing of data.
void close(void)
Close the stream; this makes further operations invalid.
Specialisation of DataStream to handle streaming data from zip archives.
FileInfoListPtr findFileInfo(const String &pattern, bool recursive=true, bool dirs=false) const
Find all files or directories matching a given pattern in this archive and get some detailed informat...
ZipDataStream(ZZIP_FILE *zzipFile, size_t uncompressedSize)
Unnamed constructor.
size_t read(void *buf, size_t count)
Read the requisite number of bytes from the stream, stopping at the end of the file.
const String & getType(void) const
Returns the factory type.
StringVectorPtr find(const String &pattern, bool recursive=true, bool dirs=false)
Find all file or directory names matching a given pattern in this archive.
Abstract factory class, archive codec plugins can register concrete subclasses of this.
struct zzip_file ZZIP_FILE
ZipArchive(const String &name, const String &archType, zzip_plugin_io_handlers *pluginIo=NULL)
void remove(const String &filename) const
Delete a named file.
Specialisation of ArchiveFactory for Zip files.
void checkZzipError(int zzipError, const String &operation) const
Handle any errors from zzip.
bool exists(const String &filename)
Find out if the named file exists (note: fully qualified filename required)
bool eof(void) const
Returns true if the stream has reached the end.
FileInfoListPtr listFileInfo(bool recursive=true, bool dirs=false)
List all files in the archive with accompanying information.
void destroyInstance(Archive *ptr)
Destroys an object which was created by this factory.
static void removeEmbbeddedFile(const String &name)
Remove an embedded file to the embedded file list.
ZipDataStream(const String &name, ZZIP_FILE *zzipFile, size_t uncompressedSize)
Constructor for creating named streams.
Archive * createInstance(const String &name, bool readOnly)
Creates a new object.
virtual ~ZipArchiveFactory()
StaticCache< 2 *OGRE_STREAM_TEMP_SIZE > mCache
We need caching because sometimes serializers step back in data stream and zziplib behaves slow.
Specialisation of ZipArchiveFactory for embedded Zip files.
virtual ~EmbeddedZipArchiveFactory()
DataStreamPtr open(const String &filename, bool readOnly=true) const
Open a stream on a given file.
static zzip_plugin_io_handlers * mPluginIo
A static pointer to file io alternative implementation for the embedded files.
zzip_plugin_io_handlers * mPluginIo
A pointer to file io alternative implementation.
void seek(size_t pos)
Repositions the read point to a specified byte.
static void addEmbbeddedFile(const String &name, const uint8 *fileData, size_t fileSize, DecryptEmbeddedZipFileFunc decryptFunc)
Add an embedded file to the embedded file list.
union _zzip_plugin_io zzip_plugin_io_handlers
time_t getModifiedTime(const String &filename)
Retrieve the modification time of a given file.
vector< FileInfo >::type FileInfoList
void skip(long count)
Skip a defined number of bytes.
size_t tell(void) const
Repositions the read point to a specified byte.
const String & getType(void) const
Returns the factory type.
Specialisation of the Archive class to allow reading of files from a zip format source archive.
StringVectorPtr list(bool recursive=true, bool dirs=false)
List all file names in the archive.
size_t write(void *buf, size_t count)
Write the requisite number of bytes from the stream (only applicable to streams that are not read-onl...
void unload()
Unloads the archive.
bool isCaseSensitive(void) const
Returns whether this archive is case sensitive in the way it matches files.
Archive * createInstance(const String &name, bool readOnly)
Creates a new object.
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.