aboutsummaryrefslogtreecommitdiff
path: root/Src/Wasabi/api/filereader/zip/zipread.h
diff options
context:
space:
mode:
authorJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
committerJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
commit20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Wasabi/api/filereader/zip/zipread.h
parent537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff)
downloadwinamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz
Initial community commit
Diffstat (limited to 'Src/Wasabi/api/filereader/zip/zipread.h')
-rw-r--r--Src/Wasabi/api/filereader/zip/zipread.h39
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