#pragma once #include "common.h" class AFX_CLASS_EXPORT T2Archive { public: T2Archive(); virtual ~T2Archive(); virtual BOOL OpenAsReadMode(const char* path); virtual BOOL OpenAsWriteMode(const char* path); virtual BOOL Close(); virtual void BeginCompressedStream(); virtual void EndCompressedStream(); virtual BOOL Skip(unsigned long); virtual int Read(void* buffer, int size); virtual int Write(const void* buffer, int size); BOOL operator>>(unsigned char& v); BOOL operator<<(unsigned char v); BOOL operator>>(char& v); BOOL operator<<(char v); BOOL operator>>(int& v); BOOL operator<<(int v); BOOL operator>>(short& v); BOOL operator<<(short v); BOOL operator>>(unsigned int& v); BOOL operator<<(unsigned int v); BOOL operator>>(unsigned long& v); BOOL operator<<(unsigned long v); BOOL operator>>(unsigned short& v); BOOL operator<<(unsigned short v); BOOL operator>>(POINT& v); BOOL operator<<(POINT v); BOOL operator>>(RECT& v); BOOL operator<<(RECT v); BOOL operator>>(CString& v); BOOL operator<<(CString& v); BOOL operator>>(char* v); BOOL operator<<(const char* v); BOOL ReadPStr(char* v); BOOL ReadPStr(CString& v); BOOL WritePStr(const char* v); BOOL ReadSRect(RECT& v); BOOL WriteSRect(const RECT& v); private: CFile *mFile; int m8; BOOL mIsReadable; BOOL mIsWritable; char *mBuffer; int mBufferLen; char *mPtr; };