libquentier 0.8.0
The library for rich desktop clients of Evernote service
Loading...
Searching...
No Matches
FileIOProcessorAsync.h
1/*
2 * Copyright 2016-2024 Dmitry Ivanov
3 *
4 * This file is part of libquentier
5 *
6 * libquentier is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation, version 3 of the License.
9 *
10 * libquentier is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with libquentier. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#pragma once
20
21#include <quentier/types/ErrorString.h>
22#include <quentier/utility/Linkage.h>
23
24#include <QByteArray>
25#include <QIODevice>
26#include <QObject>
27#include <QString>
28#include <QUuid>
29
30namespace quentier {
31
32class FileIOProcessorAsyncPrivate;
33
39{
41public:
42 explicit FileIOProcessorAsync(QObject * parent = nullptr);
43
54
62 void readyForIO();
63
75 bool success, ErrorString errorDescription, QUuid requestId);
76
89 bool success, ErrorString errorDescription, QByteArray data,
91
92public Q_SLOTS:
106 bool append);
107
116
117private:
118 FileIOProcessorAsyncPrivate * const d_ptr;
119 Q_DECLARE_PRIVATE(FileIOProcessorAsync)
120};
121
122} // namespace quentier
The ErrorString class encapsulates two (or more) strings which are meant to contain translatable (bas...
Definition ErrorString.h:43
The FileIOProcessorAsync class is a wrapper under simple file IO operations, it is meant to be used f...
Definition FileIOProcessorAsync.h:39
void readFileRequestProcessed(bool success, ErrorString errorDescription, QByteArray data, QUuid requestId)
readFileRequestProcessed signal is emitted when the file read request with given id is finished
void onWriteFileRequest(QString absoluteFilePath, QByteArray data, QUuid requestId, bool append)
onWriteFileRequest slot processes file write requests with given request ids
void readyForIO()
readyForIO signal is emitted when the queue for file IO is empty for some time (30 seconds by default...
void writeFileRequestProcessed(bool success, ErrorString errorDescription, QUuid requestId)
writeFileRequestProcessed signal is emitted when the file write request with given id is finished
void setIdleTimePeriod(qint32 seconds)
setIdleTimePeriod sets time period defining the idle state of FileIOProcessorAsync: once the time mea...
void onReadFileRequest(QString absoluteFilePath, QUuid requestId)
onReadFileRequest slot processes file read requests with given request ids
The Result template class represents the bare bones result monad implementation which either contains...
Definition Result.h:38