ACF $AcfVersion:0$
CFileWriteArchive.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
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 override;
59 virtual bool BeginTag(const iser::CArchiveTag& tag) override;
60 virtual bool EndTag(const iser::CArchiveTag& tag) override;
61 virtual bool ProcessData(void* data, int size) override;
62
63protected:
65 {
66 quint32 tagBinaryId;
68 };
69
70private:
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
Basic implementation of interface ifile::IFileArchiveInfo.
Simple implementation of archive writing to own ACF format binary file.
virtual bool EndTag(const iser::CArchiveTag &tag) override
Ends a tagged section in the archive.
bool IsArchiveValid() const
Return true if the archive is valid (e.g.
virtual bool ProcessData(void *data, int size) override
Process binary data block.
virtual bool IsTagSkippingSupported() const override
Checks if skipping to the end of a tag on EndTag() is supported.
CFileWriteArchive(const QString &filePath, const iser::IVersionInfo *versionInfoPtr=NULL, bool supportTagSkipping=true, bool serializeHeader=true)
Contructor.
virtual bool BeginTag(const iser::CArchiveTag &tag) override
Begins a tagged section in the archive.
iser::CBinaryWriteArchiveBase BaseClass
void Flush()
Force internal stream object to flush.
Process tag used to group data in archive stream.
Definition CArchiveTag.h:22
Base class for archive implementations writting data based on its binary representation.
Provides access to version information.
#define NULL
Definition istd.h:74
Contains interfaces and implementations of file system related components.