ICF 3.1.1.10
Technical documentation of ICF Libraries
CTextWriteArchiveBase.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/QTextStream>
11#include <QtCore/QIODevice>
12
13// ICF includes
15
16
17namespace iser
18{
19
20
25{
26public:
28
29 // reimplemented (iser::IArchive)
30 bool ProcessGroup(const iser::CArchiveTag& tag, std::function<bool(iser::IArchive&)> groupArchiveFn) override;
31 bool ProcessObject(const CArchiveTag& tag, ISerializable& object) override;
32 bool ProcessLeaf(const CArchiveTag& tag, bool& value) override;
33 bool ProcessLeaf(const CArchiveTag& tag, char& value) override;
34 bool ProcessLeaf(const CArchiveTag& tag, quint8& value) override;
35 bool ProcessLeaf(const CArchiveTag& tag, qint8& value) override;
36 bool ProcessLeaf(const CArchiveTag& tag, quint16& value) override;
37 bool ProcessLeaf(const CArchiveTag& tag, qint16& value) override;
38 bool ProcessLeaf(const CArchiveTag& tag, quint32& value) override;
39 bool ProcessLeaf(const CArchiveTag& tag, qint32& value) override;
40 bool ProcessLeaf(const CArchiveTag& tag, quint64& value) override;
41 bool ProcessLeaf(const CArchiveTag& tag, qint64& value) override;
42 bool ProcessLeaf(const CArchiveTag& tag, float& value) override;
43 bool ProcessLeaf(const CArchiveTag& tag, double& value) override;
44 bool ProcessLeaf(const CArchiveTag& tag, QByteArray& value) override;
45 bool ProcessLeaf(const CArchiveTag& tag, QString& value) override;
46 bool ProcessBytes(const CArchiveTag& tag, void* dataPtr, int size) override;
47
48protected:
49 explicit CTextWriteArchiveBase(const IVersionInfo* versionInfoPtr);
50
54 virtual bool WriteTextNode(const QByteArray& text) = 0;
59 virtual bool BeginTag(const CArchiveTag& tag) = 0;
60
65 virtual bool EndTag(const CArchiveTag& tag) = 0;
66};
67
68
69} // namespace iser
70
71
Process tag used to group data in archive stream.
Definition CArchiveTag.h:25
Common archive implementation of text-based storing archives.
bool ProcessLeaf(const CArchiveTag &tag, quint8 &value) override
Process primitive type.
bool ProcessLeaf(const CArchiveTag &tag, double &value) override
Process primitive type.
bool ProcessLeaf(const CArchiveTag &tag, char &value) override
Process primitive type.
bool ProcessLeaf(const CArchiveTag &tag, bool &value) override
Process primitive type.
bool ProcessLeaf(const CArchiveTag &tag, quint64 &value) override
Process primitive type.
bool ProcessLeaf(const CArchiveTag &tag, quint32 &value) override
Process primitive type.
virtual bool EndTag(const CArchiveTag &tag)=0
End of archive tag.
virtual bool BeginTag(const CArchiveTag &tag)=0
Begin of archive tag.
bool ProcessLeaf(const CArchiveTag &tag, QString &value) override
Process primitive type.
bool ProcessLeaf(const CArchiveTag &tag, quint16 &value) override
Process primitive type.
bool ProcessLeaf(const CArchiveTag &tag, float &value) override
Process primitive type.
bool ProcessGroup(const iser::CArchiveTag &tag, std::function< bool(iser::IArchive &)> groupArchiveFn) override
bool ProcessLeaf(const CArchiveTag &tag, QByteArray &value) override
Process primitive type.
bool ProcessLeaf(const CArchiveTag &tag, qint8 &value) override
Process primitive type.
bool ProcessBytes(const CArchiveTag &tag, void *dataPtr, int size) override
Process binary data block.
virtual bool WriteTextNode(const QByteArray &text)=0
Write single unformatted text node.
bool ProcessLeaf(const CArchiveTag &tag, qint64 &value) override
Process primitive type.
CTextWriteArchiveBase(const IVersionInfo *versionInfoPtr)
bool ProcessObject(const CArchiveTag &tag, ISerializable &object) override
Process object enclosed by some tag.
bool ProcessLeaf(const CArchiveTag &tag, qint32 &value) override
Process primitive type.
bool ProcessLeaf(const CArchiveTag &tag, qint16 &value) override
Process primitive type.
Basic implementation of an abstract archive for data writting.
Represent input/output persistence archive.
Definition IArchive.h:34
Common class for all classes which objects can be archived or restored from archive.
Provides access to version information.
Contains general persistence mechanism with basic archives implementations.

© Witold Gantzke and Kirill Lepskiy