blob: bf5133637d9a3bff9a109fe25922631b8ab4803a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
// Copyright 2008-2021 The Mumble Developers. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
#ifndef MUMBLE_OSINFO_H_
#define MUMBLE_OSINFO_H_
#include <QtCore/QList>
#include <QtCore/QString>
class QDomDocument;
class QDomElement;
class QHostAddress;
class OSInfo {
public:
/// If \p build is false, returns the operating system architecture.
/// If \p build is true, returns the build architecture.
static QString getArchitecture(const bool build);
/// Returns an hash generated from the primary network interface's MAC address.
static QString getMacHash(const QList< QHostAddress > & = QList< QHostAddress >());
/// Returns the operating system's basename.
/// Examples: "Windows", "Linux", "macOS", "FreeBSD", "Unknown", etc.
static QString getOS();
/// Returns the complete operating system version.
///
/// Examples:
/// "Windows 10 Enterprise 2009 19042.804 [x64]"
/// "Debian GNU/Linux bullseye/sid [x64]"
///
/// The architecture is not explicitly added when \p appendArch is false.
static QString getOSDisplayableVersion(const bool appendArch = true);
/// Returns the operating system's version.
/// Examples: "10.0.19042.1", "10.16.0 20C69"
static QString getOSVersion();
static void fillXml(QDomDocument &doc, QDomElement &root, const QList< QHostAddress > & = {});
};
#endif
|