PrismLauncher/libraries/systeminfo/include/sys.h

46 lines
1.1 KiB
C
Raw Normal View History

#pragma once
#include <QString>
namespace Sys {
const uint64_t mebibyte = 1024ull * 1024ull;
enum class KernelType { Undetermined, Windows, Darwin, Linux };
struct KernelInfo {
2018-07-15 13:51:05 +01:00
QString kernelName;
QString kernelVersion;
KernelType kernelType = KernelType::Undetermined;
int kernelMajor = 0;
int kernelMinor = 0;
int kernelPatch = 0;
bool isCursed = false;
};
KernelInfo getKernelInfo();
struct DistributionInfo {
2018-07-15 13:51:05 +01:00
DistributionInfo operator+(const DistributionInfo& rhs) const
{
DistributionInfo out;
if (!distributionName.isEmpty()) {
2018-07-15 13:51:05 +01:00
out.distributionName = distributionName;
} else {
2018-07-15 13:51:05 +01:00
out.distributionName = rhs.distributionName;
}
if (!distributionVersion.isEmpty()) {
2018-07-15 13:51:05 +01:00
out.distributionVersion = distributionVersion;
} else {
2018-07-15 13:51:05 +01:00
out.distributionVersion = rhs.distributionVersion;
}
return out;
}
QString distributionName;
QString distributionVersion;
};
DistributionInfo getDistributionInfo();
uint64_t getSystemRam();
} // namespace Sys