Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
quniquehandle_types.cpp
Go to the documentation of this file.
1
// Copyright (C) 2024 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
4
#
include
<
QtCore
/
private
/
quniquehandle_types_p
.
h
>
5
6
#
include
"qplatformdefs.h"
// For QT_CLOSE
7
8
#
ifdef
Q_OS_WIN
9
#
include
<
QtCore
/
qt_windows
.
h
>
10
#
endif
11
12
#
ifdef
Q_OS_UNIX
13
#
include
<
QtCore
/
private
/
qcore_unix_p
.
h
>
// for qt_safe_close
14
#
endif
15
16
QT_BEGIN_NAMESPACE
17
18
namespace
QtUniqueHandleTraits
{
19
20
#
ifdef
Q_OS_WIN
21
22
bool
InvalidHandleTraits
::
close
(
Type
handle
)
noexcept
23
{
24
return
::
CloseHandle
(
handle
);
25
}
26
27
bool
NullHandleTraits
::
close
(
Type
handle
)
noexcept
28
{
29
return
::
CloseHandle
(
handle
);
30
}
31
32
#
endif
33
34
bool
FileDescriptorHandleTraits
::
close
(
Type
handle
)
35
{
36
// not noexcept because close() is a POSIX cancellation point
37
return
QT_CLOSE
(
handle
) == 0;
38
}
39
40
bool
FILEHandleTraits
::
close
(
Type
handle
)
41
{
42
// not noexcept because fclose() is a POSIX cancellation point
43
return
::
fclose
(
handle
);
44
}
45
46
}
// namespace QtUniqueHandleTraits
47
48
#
ifdef
Q_OS_UNIX
49
50
using
QUniqueFileDescriptorHandle = QUniqueHandle<QtUniqueHandleTraits::FileDescriptorHandleTraits>;
51
52
#
endif
53
54
QT_END_NAMESPACE
QtUniqueHandleTraits
Definition
quniquehandle_types.cpp:18
qtbase
src
corelib
tools
quniquehandle_types.cpp
Generated on Sun Mar 9 2025 00:40:48 for Qt by
1.13.2