diff options
Diffstat (limited to 'src/corelib/kernel/qsystemerror_p.h')
-rw-r--r-- | src/corelib/kernel/qsystemerror_p.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/corelib/kernel/qsystemerror_p.h b/src/corelib/kernel/qsystemerror_p.h index 66c434cb13..72ced63dc5 100644 --- a/src/corelib/kernel/qsystemerror_p.h +++ b/src/corelib/kernel/qsystemerror_p.h @@ -40,12 +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 |