14QRandomAccessAsyncFileBackend::~QRandomAccessAsyncFileBackend() =
default;
20 Q_Q(QRandomAccessAsyncFile);
22#if defined(QT_RANDOMACCESSASYNCFILE_QIORING) || defined(Q_OS_DARWIN)
23 m_backend = std::make_unique<QRandomAccessAsyncFileNativeBackend>(q);
25 if (!m_backend || !m_backend->init()) {
26#if QT_CONFIG(thread) && QT_CONFIG(future)
27 m_backend = std::make_unique<QRandomAccessAsyncFileThreadPoolBackend>(q);
29 bool result = m_backend->init();
35QRandomAccessAsyncFile::QRandomAccessAsyncFile(QObject *parent)
36 : QObject{*
new QRandomAccessAsyncFilePrivate, parent}
41QRandomAccessAsyncFile::~QRandomAccessAsyncFile()
46void QRandomAccessAsyncFile::close()
48 Q_D(QRandomAccessAsyncFile);
52qint64 QRandomAccessAsyncFile::size()
const
54 Q_D(
const QRandomAccessAsyncFile);
59
60
61
62
63
64
65QIOOperation *QRandomAccessAsyncFile::open(
const QString &filePath, QIODeviceBase::OpenMode mode)
67 Q_D(QRandomAccessAsyncFile);
68 return d->open(filePath, mode);
72
73
74
75
76
77
78QIOOperation *QRandomAccessAsyncFile::flush()
80 Q_D(QRandomAccessAsyncFile);
85
86
87
88
89
90
91
92
93
94
95
96
97QIOReadOperation *QRandomAccessAsyncFile::read(qint64 offset, qint64 maxSize)
99 Q_D(QRandomAccessAsyncFile);
101 qWarning(
"Using a negative maxSize in QRandomAccessAsyncFile::read() is incorrect. "
102 "Resetting to zero!");
105 return d->read(offset, maxSize);
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127QIOVectoredReadOperation *
128QRandomAccessAsyncFile::readInto(qint64 offset, QSpan<std::byte> buffer)
130 Q_D(QRandomAccessAsyncFile);
131 return d->readInto(offset, buffer);
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153QIOVectoredReadOperation *
154QRandomAccessAsyncFile::readInto(qint64 offset, QSpan<
const QSpan<std::byte>> buffers)
156 Q_D(QRandomAccessAsyncFile);
157 return d->readInto(offset, buffers);
161
162
163
164
165
166
167
168
169QIOWriteOperation *QRandomAccessAsyncFile::write(qint64 offset,
const QByteArray &data)
171 Q_D(QRandomAccessAsyncFile);
172 return d->write(offset, data);
176
177
178
179
180
181
182
183
184
185QIOWriteOperation *QRandomAccessAsyncFile::write(qint64 offset, QByteArray &&data)
187 Q_D(QRandomAccessAsyncFile);
188 return d->write(offset, std::move(data));
192
193
194
195
196
197
198
199
200
201
202
203
204QIOVectoredWriteOperation *
205QRandomAccessAsyncFile::writeFrom(qint64 offset, QSpan<
const std::byte> buffer)
207 Q_D(QRandomAccessAsyncFile);
208 return d->writeFrom(offset, buffer);
212
213
214
215
216
217
218
219
220
221
222
223
224QIOVectoredWriteOperation *
225QRandomAccessAsyncFile::writeFrom(qint64 offset, QSpan<
const QSpan<
const std::byte>> buffers)
227 Q_D(QRandomAccessAsyncFile);
228 return d->writeFrom(offset, buffers);
233#include "moc_qrandomaccessasyncfile_p.cpp"
~QRandomAccessAsyncFilePrivate() override
Combined button and popup list for selecting options.