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>
|
| 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
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
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 |