diff options
Diffstat (limited to 'src/corelib/kernel/qsystemerror_p.h')
-rw-r--r-- | src/corelib/kernel/qsystemerror_p.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/corelib/kernel/qsystemerror_p.h b/src/corelib/kernel/qsystemerror_p.h index 9f3ec7427d..72ced63dc5 100644 --- a/src/corelib/kernel/qsystemerror_p.h +++ b/src/corelib/kernel/qsystemerror_p.h @@ -40,10 +40,19 @@ public: constexpr ErrorScope scope() const { return errorScope; } constexpr int error() const { return errorCode; } + constexpr bool ok() const noexcept { return errorScope == NoError; } + static constexpr QSystemError stdError(int error) + { return QSystemError(error, StandardLibraryError); } + static Q_CORE_EXPORT QString string(ErrorScope errorScope, int errorCode); static Q_CORE_EXPORT QString stdString(int errorCode = -1); #ifdef Q_OS_WIN static Q_CORE_EXPORT QString windowsString(int errorCode = -1); + using HRESULT = long; + static Q_CORE_EXPORT QString windowsComString(HRESULT hr); + + static constexpr QSystemError nativeError(int error) + { return QSystemError(error, NativeError); } #endif // data members |