ACF $AcfVersion:0$
CFileReadArchive.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ACF-Commercial
2#pragma once
3
4
5// Qt includes
6#include <QtCore/QVector>
7#include <QtCore/QFile>
8
9// ACF includes
12
13
14namespace ifile
15{
16
17
26 public CFileArchiveInfo
27{
28public:
31
41 CFileReadArchive(const QString& filePath, bool supportTagSkipping = true, bool serializeHeader = true);
42
43 // reimplemented (ifile::IArchive)
44 virtual bool IsTagSkippingSupported() const override;
45 virtual bool BeginTag(const iser::CArchiveTag& tag) override;
46 virtual bool EndTag(const iser::CArchiveTag& tag) override;
47 virtual bool ProcessData(void* data, int size) override;
48
49protected:
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 override;
64
65 // reimplemented (iser::CArchiveBase)
66 virtual int GetMaxStringLength() const override;
67
68private:
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
Basic implementation of interface ifile::IFileArchiveInfo.
Simple implementation of archive reading from own ACF format binary file.
iser::CBinaryReadArchiveBase BaseClass
virtual void DecorateMessage(istd::IInformationProvider::InformationCategory category, int id, int flags, QString &message, QString &messageSource) const override
Decorate message parts before outputting.
CFileArchiveInfo BaseClass2
CFileReadArchive(const QString &filePath, bool supportTagSkipping=true, bool serializeHeader=true)
Contructor.
virtual bool EndTag(const iser::CArchiveTag &tag) override
Ends a tagged section in the archive.
virtual bool IsTagSkippingSupported() const override
Checks if skipping to the end of a tag on EndTag() is supported.
virtual int GetMaxStringLength() const override
Get maximal allowed string size.
virtual bool ProcessData(void *data, int size) override
Process binary data block.
virtual bool BeginTag(const iser::CArchiveTag &tag) override
Begins a tagged section in the archive.
Process tag used to group data in archive stream.
Definition CArchiveTag.h:22
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.