Read,
Write
};
+public:
+ static bool isZLibCompressed(const std::string &filename);
+ static bool isSnappyCompressed(const std::string &filename);
public:
File(const std::string &filename = std::string(),
File::Mode mode = File::Read);
bool read(void *buffer, int length);
void close();
void flush();
- char getc();
+ int getc();
protected:
virtual bool rawOpen(const std::string &filename, File::Mode mode) = 0;
virtual bool rawWrite(const void *buffer, int length) = 0;
virtual bool rawRead(void *buffer, int length) = 0;
- virtual char rawGetc() = 0;
+ virtual int rawGetc() = 0;
virtual void rawClose() = 0;
virtual void rawFlush() = 0;
virtual bool rawOpen(const std::string &filename, File::Mode mode);
virtual bool rawWrite(const void *buffer, int length);
virtual bool rawRead(void *buffer, int length);
- virtual char rawGetc();
+ virtual int rawGetc();
virtual void rawClose();
virtual void rawFlush();
private:
virtual bool rawOpen(const std::string &filename, File::Mode mode);
virtual bool rawWrite(const void *buffer, int length);
virtual bool rawRead(void *buffer, int length);
- virtual char rawGetc();
+ virtual int rawGetc();
virtual void rawClose();
virtual void rawFlush();