Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qsystemerror_p.h
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
5
#
ifndef
QSYSTEMERROR_P_H
6
#
define
QSYSTEMERROR_P_H
7
8
//
9
// W A R N I N G
10
// -------------
11
//
12
// This file is not part of the Qt API. It exists purely as an
13
// implementation detail. This header file may change from version to
14
// version without notice, or even be removed.
15
//
16
// We mean it.
17
//
18
19
#
include
<
QtCore
/
private
/
qglobal_p
.
h
>
20
#
include
<
qstring
.
h
>
21
22
QT_BEGIN_NAMESPACE
23
24
class
QSystemError
25
{
26
public
:
27
enum
ErrorScope
28
{
29
NoError
,
30
StandardLibraryError
,
31
NativeError
32
};
33
34
constexpr
explicit
QSystemError
(
int
error,
ErrorScope
scope)
35
:
errorCode
(error),
errorScope
(scope)
36
{
37
}
38
constexpr
QSystemError
() =
default
;
39
40
QString
toString
()
const
{
return
string(
errorScope
,
errorCode
); }
41
constexpr
ErrorScope
scope
()
const
{
return
errorScope
; }
42
constexpr
int
error
()
const
{
return
errorCode
; }
43
44
constexpr
bool
ok
()
const
noexcept
{
return
errorScope
==
NoError
; }
45
static
constexpr
QSystemError
stdError
(
int
error)
46
{
return
QSystemError
(
error
,
StandardLibraryError
)
; }
47
48
static
Q_CORE_EXPORT QString
string
(
ErrorScope
errorScope
,
int
errorCode
);
49
static
Q_CORE_EXPORT QString
stdString
(
int
errorCode
= -1);
50
#
ifdef
Q_OS_WIN
51
static
Q_CORE_EXPORT
QString
windowsString
(
int
errorCode
= -1);
52
using
HRESULT
=
long
;
53
static
Q_CORE_EXPORT
QString
windowsComString
(
HRESULT
hr
);
54
55
static
constexpr
QSystemError
nativeError
(
int
error
)
56
{
return
QSystemError
(
error
,
NativeError
); }
57
#
endif
58
59
// data members
60
int
errorCode
= 0;
61
ErrorScope
errorScope
=
NoError
;
62
};
63
64
QT_END_NAMESPACE
65
66
#
endif
// QSYSTEMERROR_P_H
QSystemError
Definition
qsystemerror_p.h:25
QSystemError::ok
constexpr bool ok() const noexcept
Definition
qsystemerror_p.h:44
QSystemError::QSystemError
constexpr QSystemError(int error, ErrorScope scope)
Definition
qsystemerror_p.h:34
QSystemError::errorScope
ErrorScope errorScope
Definition
qsystemerror_p.h:61
QSystemError::QSystemError
constexpr QSystemError()=default
QSystemError::error
constexpr int error() const
Definition
qsystemerror_p.h:42
QSystemError::errorCode
int errorCode
Definition
qsystemerror_p.h:60
QSystemError::toString
QString toString() const
Definition
qsystemerror_p.h:40
QSystemError::ErrorScope
ErrorScope
Definition
qsystemerror_p.h:28
QSystemError::NoError
@ NoError
Definition
qsystemerror_p.h:29
QSystemError::StandardLibraryError
@ StandardLibraryError
Definition
qsystemerror_p.h:30
QSystemError::NativeError
@ NativeError
Definition
qsystemerror_p.h:31
QSystemError::scope
constexpr ErrorScope scope() const
Definition
qsystemerror_p.h:41
QSystemError::stdError
static constexpr QSystemError stdError(int error)
Definition
qsystemerror_p.h:45
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qt_error_string
QString qt_error_string(int code)
Definition
qsystemerror.cpp:152
standardLibraryErrorString
static QString standardLibraryErrorString(int errorCode)
Definition
qsystemerror.cpp:72
qtbase
src
corelib
kernel
qsystemerror_p.h
Generated on
for Qt by
1.18.0