CMemoryWriteArchive.h
Go to the documentation of this file.
1 #ifndef iser_CMemoryWriteArchive_included
2 #define iser_CMemoryWriteArchive_included
3 
4 
5 // Qt includes
6 #include <QtCore/QByteArray>
7 
8 // ACF includes
10 
11 
12 namespace iser
13 {
14 
15 
23 {
24 public:
26 
28  const IVersionInfo* versionInfoPtr = NULL,
29  bool serializeHeader = true);
30 
31  const void* GetBuffer() const;
32  int GetBufferSize() const;
33 
37  void Reset();
38 
39  bool operator==(const CMemoryWriteArchive& archive) const;
40  bool operator!=(const CMemoryWriteArchive& archive) const;
41 
42  // reimplemented (iser::IArchive)
43  virtual bool ProcessData(void* data, int size);
44 
45 protected:
46  typedef QByteArray DataBuffer;
47 
49 
51 };
52 
53 
54 // inline methods
55 
56 inline bool CMemoryWriteArchive::operator==(const CMemoryWriteArchive& archive) const
57 {
58  return m_dataBuffer == archive.m_dataBuffer;
59 }
60 
61 
62 inline bool CMemoryWriteArchive::operator!=(const CMemoryWriteArchive& archive) const
63 {
64  return m_dataBuffer != archive.m_dataBuffer;
65 }
66 
67 
68 } // namespace iser
69 
70 
71 #endif // !iser_CMemoryWriteArchive_included
72 
73 
Provides access to version information.
Definition: IVersionInfo.h:22
void Reset()
Reset internal buffer.
Base class for archive implementations writting data based on its binary representation.
bool operator==(const CMemoryWriteArchive &archive) const
virtual bool ProcessData(void *data, int size)
Process binary data block.
CBinaryWriteArchiveBase BaseClass
#define NULL
Definition: istd.h:64
Implementation of archive using memory buffer to store the persistent objects.
CMemoryWriteArchive(const IVersionInfo *versionInfoPtr=NULL, bool serializeHeader=true)
const void * GetBuffer() const
bool operator!=(const CMemoryWriteArchive &archive) const

© 2007-2017 Witold Gantzke and Kirill Lepskiy