CMemoryReadArchive.h
Go to the documentation of this file.
1 #ifndef iser_CMemoryReadArchive_included
2 #define iser_CMemoryReadArchive_included
3 
4 
5 // ACF includes
7 
8 
9 namespace iser
10 {
11 
12 
13 class ISerializable;
14 class CMemoryWriteArchive;
15 
16 
24 {
25 public:
27 
29  const void* bufferPtr,
30  int bufferSize,
31  bool serializeHeader = true);
33  const CMemoryWriteArchive& writeArchive,
34  bool serializeHeader = true);
35 
39  virtual void ResetPosition();
40 
45  virtual bool IsValid() const;
46 
47  // reimplemented (iser::IArchive)
48  virtual bool ProcessData(void* data, int size);
49 
50  // static methods
54  static bool CloneObjectByArchive(const ISerializable& source, ISerializable& result);
55 
56 protected:
57  // reimplemented (iser::CArchiveBase)
58  virtual int GetMaxStringLength() const;
59 
60  const quint8* m_bufferPtr;
63  bool m_isValid;
64 };
65 
66 
67 } // namespace iser
68 
69 
70 #endif // !iser_CMemoryReadArchive_included
71 
72 
virtual void ResetPosition()
Seeks internal cursor to the begin of data.
CMemoryReadArchive(const void *bufferPtr, int bufferSize, bool serializeHeader=true)
virtual int GetMaxStringLength() const
Get maximal allowed string size.
static bool CloneObjectByArchive(const ISerializable &source, ISerializable &result)
Clone serializable objects using iser::CMemoryWriteArchive and iser::CMemoryReadArchive archives...
Common class for all classes which objects can be archived or restored from archive.
Definition: ISerializable.h:23
Base class for archive implementations reading data based on its binary representation.
Implementation of archive using memory buffer to read the persistent objects.
virtual bool ProcessData(void *data, int size)
Process binary data block.
CBinaryReadArchiveBase BaseClass
Implementation of archive using memory buffer to store the persistent objects.
virtual bool IsValid() const
Returns true if the archive is in valid state and internal position cursor has not reached end of arc...

© 2007-2017 Witold Gantzke and Kirill Lepskiy