ICF 3.1.1.10
Technical documentation of ICF Libraries
CBinaryWriteArchiveBase.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// ICF includes
11
12
13namespace iser
14{
15
16
21{
22public:
24
25 // reimplemented (iser::IArchive)
26 bool ProcessGroup(const CArchiveTag& tag, std::function<bool(IArchive&)> groupArchiveFn) override;
28 const CArchiveTag& listTag,
29 const CArchiveTag& subTag,
30 int count,
31 std::function<bool(int, IArchive&)> iterArchiveFn,
32 std::function<bool(int)> resizeFn = nullptr) override;
34 const CArchiveTag& listTag,
35 const CArchiveTag& groupTag,
36 int count,
37 std::function<bool(int, IArchive&)> groupArchiveFn,
38 std::function<bool(int)> resizeFn = nullptr) override;
39 bool ProcessObject(const CArchiveTag& tag, ISerializable& object);
40 bool ProcessLeaf(const CArchiveTag& tag, bool& value) override;
41 bool ProcessLeaf(const CArchiveTag& tag, char& value) override;
42 bool ProcessLeaf(const CArchiveTag& tag, quint8& value) override;
43 bool ProcessLeaf(const CArchiveTag& tag, qint8& value) override;
44 bool ProcessLeaf(const CArchiveTag& tag, quint16& value) override;
45 bool ProcessLeaf(const CArchiveTag& tag, qint16& value) override;
46 bool ProcessLeaf(const CArchiveTag& tag, quint32& value) override;
47 bool ProcessLeaf(const CArchiveTag& tag, qint32& value) override;
48 bool ProcessLeaf(const CArchiveTag& tag, quint64& value) override;
49 bool ProcessLeaf(const CArchiveTag& tag, qint64& value) override;
50 bool ProcessLeaf(const CArchiveTag& tag, float& value) override;
51 bool ProcessLeaf(const CArchiveTag& tag, double& value) override;
52 bool ProcessLeaf(const CArchiveTag& tag, QByteArray& value) override;
53 bool ProcessLeaf(const CArchiveTag& tag, QString& value) override;
54 bool ProcessBytes(const CArchiveTag& tag, void* dataPtr, int size) override;
55
56protected:
57 explicit CBinaryWriteArchiveBase(const IVersionInfo* versionInfoPtr);
58
64 virtual bool WriteData(const void* dataPtr, size_t size) = 0;
65
70 virtual bool BeginTag(const CArchiveTag& tag);
71
76 virtual bool EndTag(const CArchiveTag& tag);
77};
78
79
80} // namespace iser
81
82
Process tag used to group data in archive stream.
Definition CArchiveTag.h:25
Base class for archive implementations writting data based on its binary representation.
bool ProcessObject(const CArchiveTag &tag, ISerializable &object)
Process object enclosed by some tag.
bool ProcessLeaf(const CArchiveTag &tag, quint16 &value) override
Process primitive type.
bool ProcessBytes(const CArchiveTag &tag, void *dataPtr, int size) override
Process binary data block.
virtual bool WriteData(const void *dataPtr, size_t size)=0
Process binary data block.
virtual bool BeginTag(const CArchiveTag &tag)
Begin of archive tag.
bool ProcessLeaf(const CArchiveTag &tag, double &value) override
Process primitive type.
bool ProcessLeaf(const CArchiveTag &tag, quint32 &value) override
Process primitive type.
bool ProcessLeaf(const CArchiveTag &tag, qint32 &value) override
Process primitive type.
bool ProcessAnyList(const CArchiveTag &listTag, const CArchiveTag &subTag, int count, std::function< bool(int, IArchive &)> iterArchiveFn, std::function< bool(int)> resizeFn=nullptr) override
Process some list of elements.
bool ProcessLeaf(const CArchiveTag &tag, qint8 &value) override
Process primitive type.
bool ProcessLeaf(const CArchiveTag &tag, float &value) override
Process primitive type.
virtual bool EndTag(const CArchiveTag &tag)
End of archive tag.
bool ProcessLeaf(const CArchiveTag &tag, qint64 &value) override
Process primitive type.
CBinaryWriteArchiveBase(const IVersionInfo *versionInfoPtr)
bool ProcessLeaf(const CArchiveTag &tag, qint16 &value) override
Process primitive type.
bool ProcessLeaf(const CArchiveTag &tag, quint64 &value) override
Process primitive type.
bool ProcessGroup(const CArchiveTag &tag, std::function< bool(IArchive &)> groupArchiveFn) override
Process some group of elements encapsulated in single tag.
bool ProcessGroupList(const CArchiveTag &listTag, const CArchiveTag &groupTag, int count, std::function< bool(int, IArchive &)> groupArchiveFn, std::function< bool(int)> resizeFn=nullptr) override
Process list of elements in groups.
bool ProcessLeaf(const CArchiveTag &tag, QByteArray &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, quint8 &value) override
Process primitive type.
bool ProcessLeaf(const CArchiveTag &tag, QString &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