ICF 3.0.5.47
Technical documentation of ICF Libraries
CArchiveHeaderInfo.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/QMap>
11
12// ICF includes
13#include <iser/IVersionInfo.h>
14
15
16namespace iser
17{
18
19
20class IArchive;
21
22
27class CArchiveHeaderInfo: virtual public IVersionInfo
28{
29public:
31 {
32 CF_VERSIONS_UPDATED = 0xb6eca0
33 };
34
38 void Reset();
46 bool InsertVersionId(int versionId, quint32 versionNumber, const QString& description);
51 bool RemoveVersionId(int versionId);
52
54 static bool WriteArchiveHeader(IArchive& archive, const IVersionInfo* versionInfoPtr);
55
56 // reimplemented (iser::IVersionInfo)
57 VersionIds GetVersionIds() const override;
58 bool GetVersionNumber(int versionId, quint32& result) const override;
59 QString GetVersionIdDescription(int versionId) const override;
60 QString GetEncodedVersionName(int versionId, quint32 versionNumber) const override;
61
62 // reimplemented (istd::IChangeable)
63 bool CopyFrom(const istd::IChangeable& object, CompatibilityMode mode = CM_WITHOUT_REFS) override;
64
65protected:
67 {
69 QString description;
70 };
71
72private:
73 typedef QMap<int, VersionIdElement> VersionElements;
74
75 VersionElements m_versionIdList;
76};
77
78
79} // namespace iser
80
81
Represents functions related to ICF header.
VersionIds GetVersionIds() const override
Get list of version ID's.
bool CopyFrom(const istd::IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS) override
Copy this object from another one.
bool SerializeArchiveHeader(IArchive &archive)
static bool WriteArchiveHeader(IArchive &archive, const IVersionInfo *versionInfoPtr)
QString GetVersionIdDescription(int versionId) const override
Get description of version ID.
bool GetVersionNumber(int versionId, quint32 &result) const override
Get version of archived stream for specific versioning type.
bool RemoveVersionId(int versionId)
Remove single version info.
bool InsertVersionId(int versionId, quint32 versionNumber, const QString &description)
Insert new version id with its actual version number and its description.
QString GetEncodedVersionName(int versionId, quint32 versionNumber) const override
Encode version number to human readable form.
void Reset()
Remove all stored version infos.
Represent input/output persistence archive.
Definition IArchive.h:33
Provides access to version information.
QSet< int > VersionIds
Common interface for data model objects, which can be changed.
Definition IChangeable.h:32
CompatibilityMode
Control how relationship betweeen objects are interpreted.
@ CM_WITHOUT_REFS
External references are simple ignored.
Contains general persistence mechanism with basic archives implementations.

© Witold Gantzke and Kirill Lepskiy