2016-11-20 11:32:27 +00:00
|
|
|
#pragma once
|
|
|
|
#include <QString>
|
|
|
|
|
2023-08-14 17:16:53 +01:00
|
|
|
namespace Sys {
|
2021-06-23 09:55:09 +01:00
|
|
|
const uint64_t mebibyte = 1024ull * 1024ull;
|
2021-09-04 20:27:09 +01:00
|
|
|
|
2023-08-14 17:16:53 +01:00
|
|
|
enum class KernelType { Undetermined, Windows, Darwin, Linux };
|
2021-09-04 20:27:09 +01:00
|
|
|
|
2023-08-14 17:16:53 +01:00
|
|
|
struct KernelInfo {
|
2016-11-26 01:18:05 +00:00
|
|
|
QString kernelName;
|
|
|
|
QString kernelVersion;
|
2021-09-04 20:27:09 +01:00
|
|
|
|
|
|
|
KernelType kernelType = KernelType::Undetermined;
|
|
|
|
int kernelMajor = 0;
|
|
|
|
int kernelMinor = 0;
|
|
|
|
int kernelPatch = 0;
|
|
|
|
bool isCursed = false;
|
2016-11-26 01:18:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
KernelInfo getKernelInfo();
|
2016-11-21 23:57:15 +00:00
|
|
|
|
2023-08-14 17:16:53 +01:00
|
|
|
struct DistributionInfo {
|
2018-03-11 22:00:54 +00:00
|
|
|
DistributionInfo operator+(const DistributionInfo& rhs) const
|
|
|
|
{
|
|
|
|
DistributionInfo out;
|
2023-08-14 17:16:53 +01:00
|
|
|
if (!distributionName.isEmpty()) {
|
2018-03-11 22:00:54 +00:00
|
|
|
out.distributionName = distributionName;
|
2023-08-14 17:16:53 +01:00
|
|
|
} else {
|
2018-03-11 22:00:54 +00:00
|
|
|
out.distributionName = rhs.distributionName;
|
|
|
|
}
|
2023-08-14 17:16:53 +01:00
|
|
|
if (!distributionVersion.isEmpty()) {
|
2018-03-11 22:00:54 +00:00
|
|
|
out.distributionVersion = distributionVersion;
|
2023-08-14 17:16:53 +01:00
|
|
|
} else {
|
2018-03-11 22:00:54 +00:00
|
|
|
out.distributionVersion = rhs.distributionVersion;
|
|
|
|
}
|
|
|
|
return out;
|
|
|
|
}
|
|
|
|
QString distributionName;
|
|
|
|
QString distributionVersion;
|
|
|
|
};
|
|
|
|
|
|
|
|
DistributionInfo getDistributionInfo();
|
|
|
|
|
2016-11-21 23:57:15 +00:00
|
|
|
uint64_t getSystemRam();
|
2023-08-14 17:16:53 +01:00
|
|
|
} // namespace Sys
|