reader.hpp 341 B

123456789101112131415
  1. class Reader {
  2. public:
  3. enum Type {
  4. Unknown,
  5. Normal,
  6. GZIP,
  7. ZIP,
  8. JMA,
  9. };
  10. static Type detect(const char *fn, bool inspectheader);
  11. virtual unsigned size() = 0;
  12. virtual uint8_t* read(unsigned length = 0) = 0;
  13. virtual bool ready() { return true; } //can only call read() when ready() returns true
  14. };