Heart 1.3.842.34c2ab5
Heart is base back end library for your c++ Qt projects.
distversion.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018-2024 QuasarApp.
3 * Distributed under the lgplv3 software license, see the accompanying
4 * Everyone is permitted to copy and distribute verbatim copies
5 * of this license document, but changing it is not allowed.
6*/
7
8#ifndef DISTVERSION_H
9#define DISTVERSION_H
10
11#include "humanreadableobject.h"
12#include <QHash>
13#include <streambase.h>
14
15
16namespace QH {
17
21class HEARTSHARED_EXPORT DistVersion: public StreamBase, public QuasarAppUtils::iHRO {
22
23public:
24
25 operator bool() const;
26
27 unsigned short min() const;
28 void setMin(unsigned short newMin);
29 unsigned short max() const;
30 void setMax(unsigned short newMax);
31
37 int getMaxCompatible(const DistVersion& distVersion) const;
38
44 int getMinCompatible(const DistVersion& distVersion) const;
45
51 bool isSupport(unsigned short version) const;
52
53 QString toString() const override;
54
55protected:
56
57 QDataStream &fromStream(QDataStream &stream) override;
58 QDataStream &toStream(QDataStream &stream) const override;
59
60private:
61
63 unsigned short _min = 0;
64
66 unsigned short _max = 0;
67
68};
69
73typedef QHash<QString, DistVersion> VersionData;
74
78typedef QHash<unsigned short, DistVersion> PackagesVersionData;
79
80}
81#endif // DISTVERSION_H
The DistVersion class This is information of supported versions of the destinations api.
Definition distversion.h:21
The StreamBase class add support streaming data for all children classes. For correctly working all s...
Definition streambase.h:28
#define HEARTSHARED_EXPORT
The QH namespace - QuasarApp Heart namespace. This namespace contains all classes of the Heart librar...
Definition heart.cpp:13
QHash< QString, DistVersion > VersionData
VersionData This is array of all available apis and supported its versions.
Definition distversion.h:73
QHash< unsigned short, DistVersion > PackagesVersionData
PackagesVersionData This is some as VersionData but for int commands.
Definition distversion.h:78