DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
DotNetDupe::System::OperatingSystem Class Reference

Represents information about an operating system, such as the version and platform identifier. More...

#include <OperatingSystem.h>

Inheritance diagram for DotNetDupe::System::OperatingSystem:

Public Member Functions

 OperatingSystem (PlatformID platform, const Version &version)
 Initializes a new instance of the OperatingSystem class, using the specified platform identifier and version object.
PlatformID GetPlatform () const
 Gets a PlatformID value that identifies the operating system platform.
String GetServicePack () const
 Gets the service pack version represented by this OperatingSystem object.
const VersionGetVersion () const
 Gets a Version object that identifies the operating system.
String GetVersionString () const
 Gets the concatenated string representation of the platform identifier and version.
Public Member Functions inherited from DotNetDupe::System::Object
virtual ~Object ()=default
 Virtual destructor ensuring polymorphic cleanup.
virtual bool Equals (const Object &obj) const
 Determines whether the specified Object is equal to the current Object.
virtual int GetHashCode () const
 Serves as the default hash function.
bool operator== (const Object &obj) const
 Determines reference equality between two objects.
char * ToStringA () const
 Returns narrow-character string representation.
wchar_t * ToStringW () const
 Returns wide-character string representation.

Static Public Member Functions

static bool IsLinux ()
 Indicates whether the current application is running on Linux.
static bool IsWindows ()
 Indicates whether the current application is running on Windows.
Static Public Member Functions inherited from DotNetDupe::System::Object
static bool Equals (const Object &obj1, const Object &obj2)
 Static helper determining whether two object instances are equal.

Detailed Description

Represents information about an operating system, such as the version and platform identifier.

Note
Conforms to ECMA-335 Partition IV Section 5.18 (System.OperatingSystem).

Definition at line 33 of file OperatingSystem.h.

Constructor & Destructor Documentation

◆ OperatingSystem()

DotNetDupe::System::OperatingSystem::OperatingSystem ( PlatformID platform,
const Version & version )

Initializes a new instance of the OperatingSystem class, using the specified platform identifier and version object.

Parameters
platformOne of the PlatformID values that indicates the operating system platform.
versionA Version object that indicates the version of the operating system.

Definition at line 15 of file OperatingSystem.cpp.

Referenced by DotNetDupe::System::Environment::GetOperatingSystem().

Member Function Documentation

◆ GetPlatform()

PlatformID DotNetDupe::System::OperatingSystem::GetPlatform ( ) const

Gets a PlatformID value that identifies the operating system platform.

Returns
One of the PlatformID values.

Return stored platform identifier enumeration value.

Definition at line 18 of file OperatingSystem.cpp.

◆ GetServicePack()

String DotNetDupe::System::OperatingSystem::GetServicePack ( ) const

Gets the service pack version represented by this OperatingSystem object.

Returns
The service pack version, if service packs are supported; otherwise, an empty string.

Query extended OS version info via ntdll RtlGetVersion to bypass manifest compatibility checks.

Convert wide CSDVersion string to UTF-8.

Definition at line 28 of file OperatingSystem.cpp.

References DotNetDupe::System::String::String(), and DotNetDupe::System::Internal::WCharToUtf8().

◆ GetVersion()

const Version & DotNetDupe::System::OperatingSystem::GetVersion ( ) const

Gets a Version object that identifies the operating system.

Returns
A Version object that describes the operating system version.

Return stored operating system version reference.

Definition at line 23 of file OperatingSystem.cpp.

◆ GetVersionString()

String DotNetDupe::System::OperatingSystem::GetVersionString ( ) const

Gets the concatenated string representation of the platform identifier and version.

Returns
The string representation of the values returned by GetPlatform and GetVersion.

Format operating system version string.

Definition at line 51 of file OperatingSystem.cpp.

References DotNetDupe::System::String::ToString().

◆ IsLinux()

bool DotNetDupe::System::OperatingSystem::IsLinux ( )
static

Indicates whether the current application is running on Linux.

Returns
true if the current application is running on Linux; otherwise, false.

Definition at line 65 of file OperatingSystem.cpp.

◆ IsWindows()

bool DotNetDupe::System::OperatingSystem::IsWindows ( )
static

Indicates whether the current application is running on Windows.

Returns
true if the current application is running on Windows; otherwise, false.

Platform compile target is Windows.

Definition at line 56 of file OperatingSystem.cpp.


The documentation for this class was generated from the following files: