mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 02:35:38 +08:00
Ref T419, utility function if canRunOnCurrentPlatform"
This commit is contained in:
committed by
Mat Sutcliffe
parent
d1b4660b20
commit
c60692605d
@@ -192,6 +192,15 @@ namespace BlackMisc
|
||||
return platform == CPlatform::currentPlatform();
|
||||
}
|
||||
|
||||
bool CPlatform::canRunOnCurrentPlatform(const CPlatform &platform)
|
||||
{
|
||||
if (platform == currentPlatform()) { return true; }
|
||||
if (platform.isAnyWindows() && currentPlatform().isAnyWindows()) { return true; }
|
||||
if (platform == CPlatform::allOs()) { return true; }
|
||||
if (platform == CPlatform::independent()) { return true; }
|
||||
return false;
|
||||
}
|
||||
|
||||
const CPlatform &CPlatform::win32Platform()
|
||||
{
|
||||
static const CPlatform p(Win32);
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace BlackMisc
|
||||
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
|
||||
void setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant);
|
||||
|
||||
//! Compare for index
|
||||
//! \copydoc BlackMisc::Mixin::Index::comparePropertyByIndex
|
||||
int comparePropertyByIndex(const CPropertyIndex &index, const CPlatform &compareValue) const;
|
||||
|
||||
//! Convert to QString
|
||||
@@ -124,6 +124,9 @@ namespace BlackMisc
|
||||
//! Is this the current platform
|
||||
static bool isCurrentPlatform(const CPlatform &platform);
|
||||
|
||||
//! Can run on this platform
|
||||
static bool canRunOnCurrentPlatform(const CPlatform &platform);
|
||||
|
||||
//! Win32
|
||||
static const CPlatform &win32Platform();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user