summaryrefslogtreecommitdiffstats
path: root/libraries/systeminfo/include/sys.h
blob: c573eb53c908a585d0e08b4ec81c58081f9bd232 (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
48
49
#pragma once
#include <QString>

namespace Sys
{
const uint64_t megabyte = 1024ull * 1024ull;
struct KernelInfo
{
	QString kernelName;
	QString kernelVersion;
};

KernelInfo getKernelInfo();

struct DistributionInfo
{
	DistributionInfo operator+(const DistributionInfo& rhs) const
	{
		DistributionInfo out;
		if(!distributionName.isEmpty())
		{
			out.distributionName = distributionName;
		}
		else
		{
			out.distributionName = rhs.distributionName;
		}
		if(!distributionVersion.isEmpty())
		{
			out.distributionVersion = distributionVersion;
		}
		else
		{
			out.distributionVersion = rhs.distributionVersion;
		}
		return out;
	}
	QString distributionName;
	QString distributionVersion;
};

DistributionInfo getDistributionInfo();

uint64_t getSystemRam();

bool isSystem64bit();

bool isCPU64bit();
}