diff options
Diffstat (limited to 'core/include/fxcrt/fx_basic.h')
-rw-r--r-- | core/include/fxcrt/fx_basic.h | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/core/include/fxcrt/fx_basic.h b/core/include/fxcrt/fx_basic.h index b5a110b86f..dcc1081f44 100644 --- a/core/include/fxcrt/fx_basic.h +++ b/core/include/fxcrt/fx_basic.h @@ -228,58 +228,61 @@ protected: const uint8_t* m_pLoadingBuf; FX_DWORD m_LoadingSize; + }; + class IFX_BufferArchive { public: IFX_BufferArchive(FX_STRSIZE size); - virtual ~IFX_BufferArchive() { } - - virtual void Clear(); + virtual ~IFX_BufferArchive() {} + virtual void Clear(); - FX_BOOL Flush(); + FX_BOOL Flush(); + int32_t AppendBlock(const void* pBuf, size_t size); - int32_t AppendBlock(const void* pBuf, size_t size); + int32_t AppendByte(uint8_t byte); - int32_t AppendByte(uint8_t byte); + int32_t AppendDWord(FX_DWORD i); - int32_t AppendDWord(FX_DWORD i); - - int32_t AppendString(const CFX_ByteStringC& lpsz); + int32_t AppendString(const CFX_ByteStringC& lpsz); protected: - virtual FX_BOOL DoWork(const void* pBuf, size_t size) = 0; + virtual FX_BOOL DoWork(const void* pBuf, size_t size) = 0; - FX_STRSIZE m_BufSize; + FX_STRSIZE m_BufSize; - uint8_t* m_pBuffer; + uint8_t* m_pBuffer; - FX_STRSIZE m_Length; + FX_STRSIZE m_Length; }; + class CFX_FileBufferArchive : public IFX_BufferArchive { public: CFX_FileBufferArchive(FX_STRSIZE size = 32768); ~CFX_FileBufferArchive() override; - virtual void Clear(); - FX_BOOL AttachFile(IFX_StreamWrite *pFile, FX_BOOL bTakeover = FALSE); + void Clear() override; - FX_BOOL AttachFile(const FX_WCHAR* filename); + FX_BOOL AttachFile(IFX_StreamWrite *pFile, FX_BOOL bTakeover = FALSE); - FX_BOOL AttachFile(const FX_CHAR* filename); -private: + FX_BOOL AttachFile(const FX_WCHAR* filename); - virtual FX_BOOL DoWork(const void* pBuf, size_t size); + FX_BOOL AttachFile(const FX_CHAR* filename); - IFX_StreamWrite *m_pFile; +private: + FX_BOOL DoWork(const void* pBuf, size_t size) override; - FX_BOOL m_bTakeover; + IFX_StreamWrite* m_pFile; + + FX_BOOL m_bTakeover; }; + struct CFX_CharMap { static CFX_CharMap* GetDefaultMapper(int32_t codepage = 0); |