KWin
Loading...
Searching...
No Matches
version.h
Go to the documentation of this file.
1/*
2 KWin - the KDE window manager
3 This file is part of the KDE project.
4
5 SPDX-FileCopyrightText: 2023 Xaver Hugl <xaver.hugl@gmail.com>
6
7 SPDX-License-Identifier: GPL-2.0-or-later
8*/
9#pragma once
10#include "kwin_export.h"
11
12#include <QByteArray>
13#include <QString>
14
15namespace KWin
16{
17
18class KWIN_EXPORT Version
19{
20public:
21 Version(uint32_t major, uint32_t minor, uint32_t patch = 0);
22 Version() = default;
23
24 // clang-format off
25 auto operator<=> (const Version &other) const = default;
26 // clang-format on
27 bool isValid() const;
28 uint32_t majorVersion() const;
29 uint32_t minorVersion() const;
30 uint32_t patchVersion() const;
31
32 QString toString() const;
33 QByteArray toByteArray() const;
34
35 static Version parseString(QByteArrayView versionString);
36
37private:
38 uint32_t m_major = 0;
39 uint32_t m_minor = 0;
40 uint32_t m_patch = 0;
41};
42
43}
Version()=default