ResourceReader.h 809 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef NULLSOFT_RESOURCEREADER_H
  2. #define NULLSOFT_RESOURCEREADER_H
  3. #include <api/service/svcs/svc_fileread.h>
  4. class ResourceReader : public svc_fileReader
  5. {
  6. public:
  7. public:
  8. ResourceReader();
  9. virtual ~ResourceReader() { close(); }
  10. int open(const wchar_t *filename, int mode=SvcFileReader::READ);
  11. size_t read(__int8 *buffer, size_t length);
  12. size_t write(const __int8 *buffer, size_t length);
  13. void close();
  14. unsigned __int64 getPos();
  15. unsigned __int64 getLength();
  16. int canSeek();
  17. int seek(unsigned __int64 position);
  18. int exists(const wchar_t *filename);
  19. /*int remove(const char *filename) { return 0; }
  20. int move(const char *filename, const char *destfilename) { return 0; }*/
  21. protected:
  22. RECVS_DISPATCH;
  23. private:
  24. __int8 *data;
  25. size_t ptr;
  26. size_t size;
  27. HGLOBAL g;
  28. };
  29. #endif