The FileIOProcessorAsync class is a wrapper under simple file IO operations, it is meant to be used for simple asynchronous IO.
More...
#include <FileIOProcessorAsync.h>
|
void | onWriteFileRequest (QString absoluteFilePath, QByteArray data, QUuid requestId, bool append) |
| onWriteFileRequest slot processes file write requests with given request ids
|
|
void | onReadFileRequest (QString absoluteFilePath, QUuid requestId) |
| onReadFileRequest slot processes file read 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, can also be configured via setIdleTimePeriod method) after the last IO event to signal listeners that they can perform some IO via the FileIOProcessorAsync
|
|
void | writeFileRequestProcessed (bool success, ErrorString errorDescription, QUuid requestId) |
| writeFileRequestProcessed signal is emitted when the file write request with given id is finished
|
|
void | readFileRequestProcessed (bool success, ErrorString errorDescription, QByteArray data, QUuid requestId) |
| readFileRequestProcessed signal is emitted when the file read request with given id is finished
|
|
|
| FileIOProcessorAsync (QObject *parent=nullptr) |
|
void | setIdleTimePeriod (qint32 seconds) |
| setIdleTimePeriod sets time period defining the idle state of FileIOProcessorAsync: once the time measured since the last IO operation is over the specified number of seconds, the class emits readyForIO signal to any interested listeners of this event. If this method is not called ever, the default idle time period would be 30 seconds.
|
|
The FileIOProcessorAsync class is a wrapper under simple file IO operations, it is meant to be used for simple asynchronous IO.
◆ onReadFileRequest
void quentier::FileIOProcessorAsync::onReadFileRequest |
( |
QString |
absoluteFilePath, |
|
|
QUuid |
requestId |
|
) |
| |
|
slot |
onReadFileRequest slot processes file read requests with given request ids
- Parameters
-
absoluteFilePath | Absolute file path to be read |
requestId | Unique identifier of the file read request |
◆ onWriteFileRequest
void quentier::FileIOProcessorAsync::onWriteFileRequest |
( |
QString |
absoluteFilePath, |
|
|
QByteArray |
data, |
|
|
QUuid |
requestId, |
|
|
bool |
append |
|
) |
| |
|
slot |
onWriteFileRequest slot processes file write requests with given request ids
- Parameters
-
absoluteFilePath | Absolute file path to be written |
data | Data to be written to the file |
requestId | Unique identifier of the file write request |
append | If true, the data would be appended to file, otherwise the entire file would be erased before with the data is written |
◆ readFileRequestProcessed
void quentier::FileIOProcessorAsync::readFileRequestProcessed |
( |
bool |
success, |
|
|
ErrorString |
errorDescription, |
|
|
QByteArray |
data, |
|
|
QUuid |
requestId |
|
) |
| |
|
signal |
readFileRequestProcessed signal is emitted when the file read request with given id is finished
- Parameters
-
success | True if read operation was successful, false otherwise |
errorDescription | Textual description of the error |
data | Data read from file |
requestId | Unique identifier of the file read request |
◆ setIdleTimePeriod()
void quentier::FileIOProcessorAsync::setIdleTimePeriod |
( |
qint32 |
seconds | ) |
|
setIdleTimePeriod sets time period defining the idle state of FileIOProcessorAsync: once the time measured since the last IO operation is over the specified number of seconds, the class emits readyForIO signal to any interested listeners of this event. If this method is not called ever, the default idle time period would be 30 seconds.
- Parameters
-
seconds | Number of seconds for idle time period |
◆ writeFileRequestProcessed
void quentier::FileIOProcessorAsync::writeFileRequestProcessed |
( |
bool |
success, |
|
|
ErrorString |
errorDescription, |
|
|
QUuid |
requestId |
|
) |
| |
|
signal |
writeFileRequestProcessed signal is emitted when the file write request with given id is finished
- Parameters
-
success | True if write operation was successful, false otherwise |
errorDescription | Textual description of the error |
requestId | Unique identifier of the file write request |