Welcome to mirror list, hosted at ThFree Co, Russian Federation.

OSInfo.h « src - github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ae2936da82d65ef120d723b439a86ad48bfc6748 (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
46
47
// Copyright 2005-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 QString &os = OSInfo::getOS(),
						const QString &osver          = OSInfo::getOSVersion(),
						const QList< QHostAddress > & = QList< QHostAddress >());
};

#endif