Heart
1.4.918.d927d9c
Heart is base back end library for your c++ Qt projects.
Toggle main menu visibility
Loading...
Searching...
No Matches
apiversion.cpp
Go to the documentation of this file.
1
//#
2
//# Copyright (C) 2020-2025 QuasarApp.
3
//# Distributed under the GPLv3 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
#include "
apiversion.h
"
9
10
namespace
QH
{
11
namespace
PKG
{
12
13
14
APIVersion::APIVersion
() {
15
16
}
17
18
QDataStream &
APIVersion::fromStream
(QDataStream &stream) {
19
20
stream >> _apisVersions;
21
stream >> _packagesVersions;
22
return
stream;
23
}
24
25
QDataStream &
APIVersion::toStream
(QDataStream &stream)
const
{
26
stream << _apisVersions;
27
stream << _packagesVersions;
28
29
return
stream;
30
}
31
32
VersionData
APIVersion::apisVersions
()
const
{
33
return
_apisVersions;
34
}
35
36
void
APIVersion::setApisVersions
(
const
VersionData
&newApisVersions) {
37
_apisVersions = newApisVersions;
38
}
39
40
PackagesVersionData
APIVersion::packagesVersions
()
const
{
41
return
_packagesVersions;
42
}
43
44
void
APIVersion::setPackagesVersions
(
const
PackagesVersionData
&newPackagesVersions) {
45
_packagesVersions = newPackagesVersions;
46
}
47
48
bool
APIVersion::isValid
()
const
{
49
if
(_apisVersions.isEmpty())
50
return
false
;
51
52
for
(
const
auto
&
version
: _apisVersions) {
53
if
(
version
.max() <
version
.min()) {
54
return
false
;
55
}
56
}
57
58
for
(
const
auto
&
version
: _packagesVersions) {
59
if
(
version
.max() <
version
.min()) {
60
return
false
;
61
}
62
}
63
64
return
true
;
65
}
66
67
}
68
}
apiversion.h
QH::PKG::APIVersion::setPackagesVersions
void setPackagesVersions(const PackagesVersionData &newPackagesVersions)
Definition
apiversion.cpp:44
QH::PKG::APIVersion::setApisVersions
void setApisVersions(const VersionData &newApisVersions)
Definition
apiversion.cpp:36
QH::PKG::APIVersion::APIVersion
APIVersion()
Definition
apiversion.cpp:14
QH::PKG::APIVersion::isValid
bool isValid() const override
Definition
apiversion.cpp:48
QH::PKG::APIVersion::apisVersions
VersionData apisVersions() const
Definition
apiversion.cpp:32
QH::PKG::APIVersion::fromStream
QDataStream & fromStream(QDataStream &stream) override
fromStream This method should be read all bytes from the stream object and full the current object.
Definition
apiversion.cpp:18
QH::PKG::APIVersion::version
static unsigned short version()
Definition
apiversion.h:30
QH::PKG::APIVersion::packagesVersions
PackagesVersionData packagesVersions() const
packagesVersions This method return list of available multi-version packages on the node.
Definition
apiversion.cpp:40
QH::PKG::APIVersion::toStream
QDataStream & toStream(QDataStream &stream) const override
fromStream This method should be write all members of the current object to the stream object.
Definition
apiversion.cpp:25
QH::PKG
The PKG namesapce - this namespace contains all default packages of the Heart library....
Definition
heart.h:211
QH
The QH namespace - QuasarApp Heart namespace. This namespace contains all classes of the Heart librar...
Definition
heart.cpp:13
QH::VersionData
QHash< QString, DistVersion > VersionData
VersionData This is array of all available apis and supported its versions.
Definition
distversion.h:78
QH::PackagesVersionData
QHash< unsigned short, DistVersion > PackagesVersionData
PackagesVersionData This is some as VersionData but for int commands.
Definition
distversion.h:83
src
private
apiversion.cpp
Generated by
1.18.0