1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-16 14:50:01 +00:00
Aquaria/ExternalLibs/ttvfs_zip/VFSFileZip.h

40 lines
955 B
C
Raw Normal View History

#ifndef VFSFILE_ZIP_H
#define VFSFILE_ZIP_H
#include "VFSFile.h"
2014-04-06 17:19:33 +00:00
#include "VFSZipArchiveRef.h"
VFS_NAMESPACE_START
2014-04-06 17:19:33 +00:00
class ZipFile : public File
{
public:
2014-04-06 17:19:33 +00:00
ZipFile(const char *name, ZipArchiveRef *zref, vfspos uncompSize, unsigned int fileIdx);
virtual ~ZipFile();
virtual bool open(const char *mode = NULL);
2014-04-06 17:19:33 +00:00
virtual bool isopen() const;
virtual bool iseof() const;
virtual void close();
virtual bool seek(vfspos pos, int whence);
virtual bool flush();
virtual vfspos getpos() const;
virtual unsigned int read(void *dst, unsigned int bytes);
virtual unsigned int write(const void *src, unsigned int bytes);
2014-04-06 17:19:33 +00:00
virtual vfspos size();
virtual const char *getType() const { return "ZipFile"; }
protected:
2014-04-06 17:19:33 +00:00
bool unpack();
char *_buf;
vfspos _pos;
CountedPtr<ZipArchiveRef> _archiveHandle;
vfspos _uncompSize;
unsigned int _fileIdx;
std::string _mode;
};
VFS_NAMESPACE_END
#endif