diff options
author | Jean-Francois Mauguit <jfmauguit@mac.com> | 2024-09-24 09:03:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-24 09:03:25 -0400 |
commit | bab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Wasabi/api/filereader/zip/zipread.h | |
parent | 4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff) | |
parent | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff) | |
download | winamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz |
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/Wasabi/api/filereader/zip/zipread.h')
-rw-r--r-- | Src/Wasabi/api/filereader/zip/zipread.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Src/Wasabi/api/filereader/zip/zipread.h b/Src/Wasabi/api/filereader/zip/zipread.h new file mode 100644 index 00000000..7210e6bd --- /dev/null +++ b/Src/Wasabi/api/filereader/zip/zipread.h @@ -0,0 +1,39 @@ +#ifndef _ZIPREAD_H +#define _ZIPREAD_H + +#include <api/service/svcs/svc_fileread.h> +#include <api/service/servicei.h> +#include <bfc/memblock.h> +#include <bfc/string/string.h> +#include <bfc/ptrlist.h> +#include <bfc/tlist.h> + +class ZipRead : public svc_fileReaderI { +public: + // service + static const char *getServiceName() { return "ZIP file reader"; } + + int open(const char *filename, int mode=SvcFileReader::READ); + int read(char *buffer, int length); + int write(const char *buffer, int length) { return 0; } + void close(); + int getPos(); + int getLength(); + +private: + FILE *openInTempDir(const char *walName, const char *file); + + typedef struct { + String *name; + String *zipName; + Std::fileInfoStruct checksum; + } openedZipEntry; + + static wasabi::TList<openedZipEntry> openedZipHandles; + + String zipTmpDir; + + FILE *handle; +}; + +#endif//_ZIPREAD_H |