Ref T419, utility functions for platform

This commit is contained in:
Klaus Basan
2019-03-04 17:49:55 +01:00
committed by Mat Sutcliffe
parent b0b8e82a2d
commit 2cc53ce67c
2 changed files with 17 additions and 0 deletions

View File

@@ -181,6 +181,17 @@ namespace BlackMisc
return p;
}
bool CPlatform::isCurrentPlatform(const QString &platform)
{
if (platform.isEmpty()) { return false; }
return isCurrentPlatform(CPlatform::stringToPlatform(platform));
}
bool CPlatform::isCurrentPlatform(const CPlatform &platform)
{
return platform == CPlatform::currentPlatform();
}
const CPlatform &CPlatform::win32Platform()
{
static const CPlatform p(Win32);

View File

@@ -118,6 +118,12 @@ namespace BlackMisc
//! Current platform
static const CPlatform &currentPlatform();
//! Is this the current platform
static bool isCurrentPlatform(const QString &platform);
//! Is this the current platform
static bool isCurrentPlatform(const CPlatform &platform);
//! Win32
static const CPlatform &win32Platform();