CFileWriteArchive.h
Go to the documentation of this file.
1 #ifndef ifile_CFileWriteArchive_included
2 #define ifile_CFileWriteArchive_included
3 
4 
5 // Qt includes
6 #include <QtCore/QVector>
7 #include <QtCore/QFile>
8 
9 // ACF includes
11 #include <ifile/CFileArchiveInfo.h>
12 
13 
14 namespace ifile
15 {
16 
17 
26  public CFileArchiveInfo
27 {
28 public:
31 
42  const QString& filePath,
43  const iser::IVersionInfo* versionInfoPtr = NULL,
44  bool supportTagSkipping = true,
45  bool serializeHeader = true);
46 
50  bool IsArchiveValid() const;
51 
55  void Flush();
56 
57  // reimplemented (iser::IArchive)
58  virtual bool IsTagSkippingSupported() const;
59  virtual bool BeginTag(const iser::CArchiveTag& tag);
60  virtual bool EndTag(const iser::CArchiveTag& tag);
61  virtual bool ProcessData(void* data, int size);
62 
63 protected:
65  {
66  quint32 tagBinaryId;
68  };
69 
70 private:
71  QFile m_file;
72 
73  bool m_supportTagSkipping;
74 
75  typedef QVector<TagStackElement> TagStack;
76 
77  TagStack m_tagStack;
78 
79  bool m_isValid;
80 };
81 
82 
83 // public inline methods
84 
86 {
87  return m_isValid;
88 }
89 
90 
91 } // namespace ifile
92 
93 
94 #endif // !ifile_CFileWriteArchive_included
95 
Basic implementation of interface ifile::IFileArchiveInfo.
virtual bool EndTag(const iser::CArchiveTag &tag)
End of archive tag.
bool IsArchiveValid() const
Return true if the archive is valid (e.g.
virtual bool ProcessData(void *data, int size)
Process binary data block.
Provides access to version information.
Definition: IVersionInfo.h:22
Base class for archive implementations writting data based on its binary representation.
virtual bool IsTagSkippingSupported() const
Check if skiping to the end of tag on EndTag is supported.
iser::CBinaryWriteArchiveBase BaseClass
#define NULL
Definition: istd.h:64
virtual bool BeginTag(const iser::CArchiveTag &tag)
Begin of archive tag.
CFileArchiveInfo BaseClass2
Process tag used to group data in archive stream.
Definition: CArchiveTag.h:21
Simple implementation of archive writing to own ACF format binary file.
CFileWriteArchive(const QString &filePath, const iser::IVersionInfo *versionInfoPtr=NULL, bool supportTagSkipping=true, bool serializeHeader=true)
Contructor.
void Flush()
Force internal stream object to flush.

© 2007-2017 Witold Gantzke and Kirill Lepskiy