[*] Clean up SWInfo.hpp
This commit is contained in:
parent
b98baea2a8
commit
f29171e329
51
Include/Aurora/SWInfo/OSInformation.hpp
Normal file
51
Include/Aurora/SWInfo/OSInformation.hpp
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
/***
|
||||||
|
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
||||||
|
|
||||||
|
File: OSInformation.hpp
|
||||||
|
Date: 2022-1-25
|
||||||
|
Author: Reece
|
||||||
|
***/
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace Aurora::SWInfo
|
||||||
|
{
|
||||||
|
struct OSInformation
|
||||||
|
{
|
||||||
|
const AuString *kKernelString; //
|
||||||
|
const AuString *kUserlandBrand; // Windows 10 Pro, Xbox, glibc, Ubuntu, distro name
|
||||||
|
const AuString *kUserlandDesktopEnv; // DWM, CF, [kwin/etc]
|
||||||
|
const AuString *kBuildString; // Example: (`??7??.?.amd64???.rs?_release.??-??`, `Linux version wtf-doxing-lts (no-lts@fingerprinterinos) (some things here) #1 SMP Mon, 69 Apr 2000 13:33:37 +0000`)
|
||||||
|
|
||||||
|
AuUInt32 uKernelMajor {};
|
||||||
|
AuUInt32 uKernelMinor {};
|
||||||
|
AuUInt32 uKernelPatch {};
|
||||||
|
|
||||||
|
AuUInt32 uUserlandMajor {};
|
||||||
|
AuUInt32 uUserlandMinor {};
|
||||||
|
AuUInt32 uUserlandPatch {};
|
||||||
|
|
||||||
|
bool bIsServer {};
|
||||||
|
bool bIsEnterprise {};
|
||||||
|
|
||||||
|
Aurora::Build::EPlatform ePlatform = Aurora::Build::EPlatform::eEnumInvalid;
|
||||||
|
|
||||||
|
private:
|
||||||
|
static inline AuString _kIgnore {};
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
OSInformation() : kKernelString(&_kIgnore), kUserlandDesktopEnv(&_kIgnore), kUserlandBrand(&_kIgnore), kBuildString(&_kIgnore), ePlatform(Build::EPlatform::eEnumInvalid)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
AU_DEFINE_CTOR_VA(OSInformation, (
|
||||||
|
kKernelString,
|
||||||
|
kUserlandBrand,
|
||||||
|
kUserlandDesktopEnv,
|
||||||
|
kBuildString,
|
||||||
|
ePlatform
|
||||||
|
))
|
||||||
|
AU_NO_COPY(OSInformation);
|
||||||
|
AU_MOVE(OSInformation);
|
||||||
|
};
|
||||||
|
}
|
@ -7,65 +7,10 @@
|
|||||||
***/
|
***/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "OSInformation.hpp"
|
||||||
|
#include "WinVersion.hpp"
|
||||||
|
|
||||||
namespace Aurora::SWInfo
|
namespace Aurora::SWInfo
|
||||||
{
|
{
|
||||||
struct OSInformation
|
|
||||||
{
|
|
||||||
// I tried to make these references, but the special c++ andineers decided that objects and functions should hold constantness, not the data
|
|
||||||
// Returning a const reference to a struct containing const references, maintaining the ability to move, and disabling copy, is impossible
|
|
||||||
// Nice language.
|
|
||||||
|
|
||||||
const AuString *kKernelString; //
|
|
||||||
const AuString *kUserlandBrand; // Windows 10 Pro, Xbox, glibc, Ubuntu, distro name
|
|
||||||
const AuString *kUserlandDesktopEnv; // DWM, CF, [kwin/etc]
|
|
||||||
const AuString *kBuildString; // Example: (`??7??.?.amd64???.rs?_release.??-??`, `Linux version wtf-doxing-lts (no-lts@fingerprinterinos) (some things here) #1 SMP Mon, 69 Apr 2000 13:33:37 +0000`)
|
|
||||||
|
|
||||||
AuUInt32 uKernelMajor {};
|
|
||||||
AuUInt32 uKernelMinor {};
|
|
||||||
AuUInt32 uKernelPatch {};
|
|
||||||
|
|
||||||
AuUInt32 uUserlandMajor {};
|
|
||||||
AuUInt32 uUserlandMinor {};
|
|
||||||
AuUInt32 uUserlandPatch {};
|
|
||||||
|
|
||||||
bool bIsServer {};
|
|
||||||
bool bIsEnterprise {};
|
|
||||||
|
|
||||||
Aurora::Build::EPlatform ePlatform = Aurora::Build::EPlatform::eEnumInvalid;
|
|
||||||
|
|
||||||
private:
|
|
||||||
static inline AuString _kIgnore {};
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
OSInformation() : kKernelString(&_kIgnore), kUserlandDesktopEnv(&_kIgnore), kUserlandBrand(&_kIgnore), kBuildString(&_kIgnore), ePlatform(Build::EPlatform::eEnumInvalid)
|
|
||||||
{}
|
|
||||||
|
|
||||||
AU_DEFINE_CTOR_VA(OSInformation, (
|
|
||||||
kKernelString,
|
|
||||||
kUserlandBrand,
|
|
||||||
kUserlandDesktopEnv,
|
|
||||||
kBuildString,
|
|
||||||
ePlatform
|
|
||||||
))
|
|
||||||
AU_NO_COPY(OSInformation);
|
|
||||||
AU_MOVE(OSInformation);
|
|
||||||
};
|
|
||||||
|
|
||||||
AUKN_SYM const OSInformation &GetPlatformInfo();
|
AUKN_SYM const OSInformation &GetPlatformInfo();
|
||||||
|
|
||||||
// VersionHelpers.h, except it doesn't lie to you and wont break NIX land
|
|
||||||
AUKN_SYM bool IsWindowsXPOrGreater();
|
|
||||||
AUKN_SYM bool IsWindowsXPSP1OrGreater();
|
|
||||||
AUKN_SYM bool IsWindowsXPSP2OrGreater();
|
|
||||||
AUKN_SYM bool IsWindowsXPSP3OrGreater();
|
|
||||||
AUKN_SYM bool IsWindowsVistaOrGreater();
|
|
||||||
AUKN_SYM bool IsWindowsVistaSP1OrGreater();
|
|
||||||
AUKN_SYM bool IsWindowsVistaSP2OrGreater();
|
|
||||||
AUKN_SYM bool IsWindows7OrGreater();
|
|
||||||
AUKN_SYM bool IsWindows7SP1OrGreater();
|
|
||||||
AUKN_SYM bool IsWindows8OrGreater();
|
|
||||||
AUKN_SYM bool IsWindows8Point1OrGreater();
|
|
||||||
AUKN_SYM bool IsWindows10OrGreater();
|
|
||||||
AUKN_SYM bool IsWindows11OrGreater();
|
|
||||||
}
|
}
|
26
Include/Aurora/SWInfo/WinVersion.hpp
Normal file
26
Include/Aurora/SWInfo/WinVersion.hpp
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
/***
|
||||||
|
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
||||||
|
|
||||||
|
File: WinVersion.hpp
|
||||||
|
Date: 2022-1-25
|
||||||
|
Author: Reece
|
||||||
|
***/
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace Aurora::SWInfo
|
||||||
|
{
|
||||||
|
// VersionHelpers.h - except it doesn't lie to you and wont break NIX land
|
||||||
|
AUKN_SYM bool IsWindowsXPOrGreater();
|
||||||
|
AUKN_SYM bool IsWindowsXPSP1OrGreater();
|
||||||
|
AUKN_SYM bool IsWindowsXPSP2OrGreater();
|
||||||
|
AUKN_SYM bool IsWindowsXPSP3OrGreater();
|
||||||
|
AUKN_SYM bool IsWindowsVistaOrGreater();
|
||||||
|
AUKN_SYM bool IsWindowsVistaSP1OrGreater();
|
||||||
|
AUKN_SYM bool IsWindowsVistaSP2OrGreater();
|
||||||
|
AUKN_SYM bool IsWindows7OrGreater();
|
||||||
|
AUKN_SYM bool IsWindows7SP1OrGreater();
|
||||||
|
AUKN_SYM bool IsWindows8OrGreater();
|
||||||
|
AUKN_SYM bool IsWindows8Point1OrGreater();
|
||||||
|
AUKN_SYM bool IsWindows10OrGreater();
|
||||||
|
AUKN_SYM bool IsWindows11OrGreater();
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user