CFileReadArchive.h
Go to the documentation of this file.
1 #ifndef ifile_CFileReadArchive_included
2 #define ifile_CFileReadArchive_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 
41  CFileReadArchive(const QString& filePath, bool supportTagSkipping = true, bool serializeHeader = true);
42 
43  // reimplemented (ifile::IArchive)
44  virtual bool IsTagSkippingSupported() const;
45  virtual bool BeginTag(const iser::CArchiveTag& tag);
46  virtual bool EndTag(const iser::CArchiveTag& tag);
47  virtual bool ProcessData(void* data, int size);
48 
49 protected:
51  {
52  quint32 tagBinaryId;
53  quint32 endPosition;
55  };
56 
57  // reimplemented (istd::ILogger)
58  virtual void DecorateMessage(
60  int id,
61  int flags,
62  QString& message,
63  QString& messageSource) const;
64 
65  // reimplemented (iser::CArchiveBase)
66  virtual int GetMaxStringLength() const;
67 
68 private:
69  QFile m_file;
70 
71  bool m_supportTagSkipping;
72 
73  typedef QVector<TagStackElement> TagStack;
74 
75  TagStack m_tagStack;
76 };
77 
78 
79 } // namespace ifile
80 
81 
82 #endif // !ifile_CFileReadArchive_included
83 
84 
Basic implementation of interface ifile::IFileArchiveInfo.
virtual bool ProcessData(void *data, int size)
Process binary data block.
virtual int GetMaxStringLength() const
Get maximal allowed string size.
virtual bool EndTag(const iser::CArchiveTag &tag)
End of archive tag.
Base class for archive implementations reading data based on its binary representation.
Simple implementation of archive reading from own ACF format binary file.
CFileReadArchive(const QString &filePath, bool supportTagSkipping=true, bool serializeHeader=true)
Contructor.
virtual void DecorateMessage(istd::IInformationProvider::InformationCategory category, int id, int flags, QString &message, QString &messageSource) const
Decorate message parts before outputting.
virtual bool IsTagSkippingSupported() const
Check if skiping to the end of tag on EndTag is supported.
iser::CBinaryReadArchiveBase BaseClass
InformationCategory
Category of information.
Process tag used to group data in archive stream.
Definition: CArchiveTag.h:21
virtual bool BeginTag(const iser::CArchiveTag &tag)
Begin of archive tag.
CFileArchiveInfo BaseClass2

© 2007-2017 Witold Gantzke and Kirill Lepskiy