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
qiooperation_p.h
Go to the documentation of this file.
1
// Copyright (C) 2025 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
QIOOPERATION_P_H
6
#
define
QIOOPERATION_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
21
#
include
<
QtCore
/
qobject
.
h
>
22
#
include
<
QtCore
/
qspan
.
h
>
23
24
QT_BEGIN_NAMESPACE
25
26
class
QIOOperationPrivate;
27
class
Q_CORE_EXPORT
QIOOperation
:
public
QObject
28
{
29
Q_OBJECT
30
public
:
31
// TODO: more specific error codes?
32
enum
class
Error
33
{
34
None,
35
FileNotOpen,
36
IncorrectOffset,
37
Read,
38
Write,
39
Flush,
40
Open,
41
Aborted,
42
};
43
Q_ENUM(Error)
44
45
enum
class
Type : quint8
46
{
47
Unknown,
48
Read,
49
Write,
50
Flush,
51
Open,
52
};
53
Q_ENUM(Type)
54
55
~QIOOperation() override;
56
57
Type type()
const
;
58
Error error()
const
;
59
bool
isFinished()
const
;
60
61
Q_SIGNALS:
62
void
finished();
63
void
errorOccurred(Error err);
64
65
protected
:
66
QIOOperation() =
delete
;
67
Q_DISABLE_COPY_MOVE(QIOOperation)
68
explicit
QIOOperation(QIOOperationPrivate &dd, QObject *parent =
nullptr
);
69
70
void
ensureCompleteOrCanceled();
71
72
Q_DECLARE_PRIVATE(QIOOperation)
73
74
friend
class
QRandomAccessAsyncFilePrivate;
75
friend
class
QRandomAccessAsyncFileBackend;
76
friend
class
QRandomAccessAsyncFileNativeBackend;
77
friend
class
QRandomAccessAsyncFileThreadPoolBackend;
78
};
79
80
class
Q_CORE_EXPORT
QIOReadWriteOperationBase
:
public
QIOOperation
81
{
82
public
:
83
~QIOReadWriteOperationBase() override;
84
85
qint64 offset()
const
;
86
qint64 numBytesProcessed()
const
;
87
88
protected
:
89
QIOReadWriteOperationBase() =
delete
;
90
Q_DISABLE_COPY_MOVE(QIOReadWriteOperationBase)
91
explicit
QIOReadWriteOperationBase(QIOOperationPrivate &dd, QObject *parent =
nullptr
);
92
93
friend
class
QRandomAccessAsyncFilePrivate;
94
friend
class
QRandomAccessAsyncFileBackend;
95
friend
class
QRandomAccessAsyncFileNativeBackend;
96
friend
class
QRandomAccessAsyncFileThreadPoolBackend;
97
};
98
99
class
Q_CORE_EXPORT
QIOReadOperation
:
public
QIOReadWriteOperationBase
100
{
101
public
:
102
~QIOReadOperation() override;
103
104
QByteArray data()
const
;
105
106
protected
:
107
QIOReadOperation() =
delete
;
108
Q_DISABLE_COPY_MOVE(QIOReadOperation)
109
explicit
QIOReadOperation(QIOOperationPrivate &dd, QObject *parent =
nullptr
);
110
111
friend
class
QRandomAccessAsyncFilePrivate;
112
friend
class
QRandomAccessAsyncFileBackend;
113
friend
class
QRandomAccessAsyncFileNativeBackend;
114
friend
class
QRandomAccessAsyncFileThreadPoolBackend;
115
};
116
117
class
Q_CORE_EXPORT
QIOWriteOperation
:
public
QIOReadWriteOperationBase
118
{
119
public
:
120
~QIOWriteOperation() override;
121
122
QByteArray data()
const
;
123
124
protected
:
125
QIOWriteOperation() =
delete
;
126
Q_DISABLE_COPY_MOVE(QIOWriteOperation)
127
explicit
QIOWriteOperation(QIOOperationPrivate &dd, QObject *parent =
nullptr
);
128
129
friend
class
QRandomAccessAsyncFilePrivate;
130
friend
class
QRandomAccessAsyncFileBackend;
131
friend
class
QRandomAccessAsyncFileNativeBackend;
132
friend
class
QRandomAccessAsyncFileThreadPoolBackend;
133
};
134
135
class
Q_CORE_EXPORT
QIOVectoredReadOperation
:
public
QIOReadWriteOperationBase
136
{
137
public
:
138
~QIOVectoredReadOperation() override;
139
140
QSpan<
const
QSpan<std::byte>> data()
const
;
141
142
protected
:
143
QIOVectoredReadOperation() =
delete
;
144
Q_DISABLE_COPY_MOVE(QIOVectoredReadOperation)
145
explicit
QIOVectoredReadOperation(QIOOperationPrivate &dd, QObject *parent =
nullptr
);
146
147
friend
class
QRandomAccessAsyncFilePrivate;
148
friend
class
QRandomAccessAsyncFileBackend;
149
friend
class
QRandomAccessAsyncFileNativeBackend;
150
friend
class
QRandomAccessAsyncFileThreadPoolBackend;
151
};
152
153
class
Q_CORE_EXPORT
QIOVectoredWriteOperation
:
public
QIOReadWriteOperationBase
154
{
155
public
:
156
~QIOVectoredWriteOperation() override;
157
158
QSpan<
const
QSpan<
const
std::byte>> data()
const
;
159
160
protected
:
161
QIOVectoredWriteOperation() =
delete
;
162
Q_DISABLE_COPY_MOVE(QIOVectoredWriteOperation)
163
explicit
QIOVectoredWriteOperation(QIOOperationPrivate &dd, QObject *parent =
nullptr
);
164
165
friend
class
QRandomAccessAsyncFilePrivate;
166
friend
class
QRandomAccessAsyncFileBackend;
167
friend
class
QRandomAccessAsyncFileNativeBackend;
168
friend
class
QRandomAccessAsyncFileThreadPoolBackend;
169
};
170
171
QT_END_NAMESPACE
172
173
#
endif
// QIOOPERATION_P_H
QIOOperationPrivate
Definition
qiooperation_p_p.h:151
QIOOperationPrivate::State
State
Definition
qiooperation_p_p.h:156
QIOOperationPrivate::State::Finished
@ Finished
Definition
qiooperation_p_p.h:158
QIOOperationPrivate::setError
void setError(QIOOperation::Error err)
Definition
qiooperation.cpp:39
QIOOperationPrivate::state
State state
Definition
qiooperation_p_p.h:179
QIOOperationPrivate::operationComplete
void operationComplete(QIOOperation::Error err)
Definition
qiooperation.cpp:28
QIOOperationPrivate::appendBytesProcessed
void appendBytesProcessed(qint64 num)
Definition
qiooperation.cpp:23
QIOOperation
Definition
qiooperation_p.h:28
QIOReadOperation
Definition
qiooperation_p.h:100
QIOReadWriteOperationBase
Definition
qiooperation_p.h:81
QIOVectoredReadOperation
Definition
qiooperation_p.h:136
QIOVectoredWriteOperation
Definition
qiooperation_p.h:154
QIOWriteOperation
Definition
qiooperation_p.h:118
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
QtPrivate
Definition
qalloc.h:29
qtbase
src
corelib
io
qiooperation_p.h
Generated on
for Qt by
1.18.0