diff --git a/src/blackmisc/platform.cpp b/src/blackmisc/platform.cpp index 3b9f1abb9..6f8864c64 100644 --- a/src/blackmisc/platform.cpp +++ b/src/blackmisc/platform.cpp @@ -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); diff --git a/src/blackmisc/platform.h b/src/blackmisc/platform.h index c57dc6479..952879b96 100644 --- a/src/blackmisc/platform.h +++ b/src/blackmisc/platform.h @@ -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();