2016-11-20 11:32:27 +00:00
|
|
|
#pragma once
|
|
|
|
#include <QString>
|
|
|
|
|
|
|
|
namespace Sys
|
|
|
|
{
|
2021-06-23 08:55:09 +00:00
|
|
|
const uint64_t mebibyte = 1024ull * 1024ull;
|
2021-09-04 19:27:09 +00:00
|
|
|
|
|
|
|
enum class KernelType {
|
|
|
|
Undetermined,
|
|
|
|
Windows,
|
|
|
|
Darwin,
|
|
|
|
Linux
|
|
|
|
};
|
|
|
|
|
2016-11-26 01:18:05 +00:00
|
|
|
struct KernelInfo
|
|
|
|
{
|
2018-07-15 12:51:05 +00:00
|
|
|
QString kernelName;
|
|
|
|
QString kernelVersion;
|
2021-09-04 19:27:09 +00: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
|
|
|
|
2018-03-11 22:00:54 +00:00
|
|
|
struct DistributionInfo
|
|
|
|
{
|
2018-07-15 12:51:05 +00:00
|
|
|
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;
|
2018-03-11 22:00:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
DistributionInfo getDistributionInfo();
|
|
|
|
|
2016-11-21 23:57:15 +00:00
|
|
|
uint64_t getSystemRam();
|
|
|
|
|
|
|
|
bool isSystem64bit();
|
|
|
|
|
|
|
|
bool isCPU64bit();
|
2022-02-06 17:49:54 +00:00
|
|
|
|
|
|
|
bool lookupSystemStatusCode(uint64_t code, std::string &name, std::string &description);
|
2016-11-20 11:32:27 +00:00
|
|
|
}
|