zipread.h 874 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef _ZIPREAD_H
  2. #define _ZIPREAD_H
  3. #include <api/service/svcs/svc_fileread.h>
  4. #include <api/service/servicei.h>
  5. #include <bfc/memblock.h>
  6. #include <bfc/string/string.h>
  7. #include <bfc/ptrlist.h>
  8. #include <bfc/tlist.h>
  9. class ZipRead : public svc_fileReaderI {
  10. public:
  11. // service
  12. static const char *getServiceName() { return "ZIP file reader"; }
  13. int open(const char *filename, int mode=SvcFileReader::READ);
  14. int read(char *buffer, int length);
  15. int write(const char *buffer, int length) { return 0; }
  16. void close();
  17. int getPos();
  18. int getLength();
  19. private:
  20. FILE *openInTempDir(const char *walName, const char *file);
  21. typedef struct {
  22. String *name;
  23. String *zipName;
  24. Std::fileInfoStruct checksum;
  25. } openedZipEntry;
  26. static wasabi::TList<openedZipEntry> openedZipHandles;
  27. String zipTmpDir;
  28. FILE *handle;
  29. };
  30. #endif//_ZIPREAD_H