ICF 3.0.5.47
Technical documentation of ICF Libraries
CFileReadArchive.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#pragma once
7
8
9// Qt includes
10#include <QtCore/QVector>
11#include <QtCore/QFile>
12
13// ICF includes
16
17
18namespace ifile
19{
20
21
30 public CFileArchiveInfo
31{
32public:
35
45 CFileReadArchive(const QString& filePath, bool supportTagSkipping = true, bool serializeHeader = true);
46
47 // reimplemented (ifile::IArchive)
48 virtual bool IsTagSkippingSupported() const;
49 virtual bool BeginTag(const iser::CArchiveTag& tag);
50 virtual bool EndTag(const iser::CArchiveTag& tag);
51 virtual bool ProcessData(void* data, int size);
52
53protected:
55 {
56 quint32 tagBinaryId;
57 quint32 endPosition;
59 };
60
61 // reimplemented (istd::ILogger)
62 virtual void DecorateMessage(
64 int id,
65 int flags,
66 QString& message,
67 QString& messageSource) const;
68
69 // reimplemented (iser::CArchiveBase)
70 virtual int GetMaxStringLength() const;
71
72private:
73 QFile m_file;
74
75 bool m_supportTagSkipping;
76
77 typedef QVector<TagStackElement> TagStack;
78
79 TagStack m_tagStack;
80};
81
82
83} // namespace ifile
84
85
Basic implementation of interface ifile::IFileArchiveInfo.
Simple implementation of archive reading from own ICF format binary file.
CFileArchiveInfo BaseClass2
CFileReadArchive(const QString &filePath, bool supportTagSkipping=true, bool serializeHeader=true)
Contructor.
virtual bool IsTagSkippingSupported() const
Check if skiping to the end of tag on EndTag is supported.
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.
virtual bool BeginTag(const iser::CArchiveTag &tag)
Begin of archive tag.
iser::CBinaryReadArchiveBase BaseClass
virtual void DecorateMessage(istd::IInformationProvider::InformationCategory category, int id, int flags, QString &message, QString &messageSource) const
Decorate message parts before outputting.
Process tag used to group data in archive stream.
Definition CArchiveTag.h:25
Base class for archive implementations reading data based on its binary representation.
InformationCategory
Category of information.
Contains interfaces and implementations of file system related components.

© Witold Gantzke and Kirill Lepskiy