1 #pragma once 2 3 #include "Stream.h" 4 5 namespace Framework 6 { 7 8 class CMemStream : public CStream 9 { 10 public: 11 CMemStream(); 12 CMemStream(const CMemStream&); 13 virtual ~CMemStream(); 14 15 CMemStream& operator =(const CMemStream&) = delete; 16 17 uint64 Read(void*, uint64); 18 uint64 Write(const void*, uint64); 19 uint64 Tell(); 20 void Seek(int64, STREAM_SEEK_DIRECTION); 21 bool IsEOF(); 22 void ResetBuffer(); 23 void Allocate(unsigned int); 24 void Truncate(); 25 uint8* GetBuffer() const; 26 unsigned int GetSize() const; 27 28 private: 29 void CopyFrom(const CMemStream&); 30 31 unsigned int m_size = 0; 32 unsigned int m_grow = 0; 33 unsigned int m_position = 0; 34 uint8* m_data = nullptr; 35 bool m_isEof = false; 36 }; 37 38 } 39