Eneboo - Documentación para desarrolladores
|
The QIODeviceSource class is a QDataSource that draws data from a QIODevice. Más...
#include <qasyncio.h>
Métodos públicos | |
QIODeviceSource (QIODevice *, int bufsize=4096) | |
~QIODeviceSource () | |
int | readyToSend () |
void | sendTo (QDataSink *sink, int n) |
bool | rewindable () const |
void | enableRewind (bool on) |
void | rewind () |
QIODeviceSource (QIODevice *, int bufsize=4096) | |
~QIODeviceSource () | |
int | readyToSend () |
void | sendTo (QDataSink *sink, int n) |
bool | rewindable () const |
void | enableRewind (bool on) |
void | rewind () |
The QIODeviceSource class is a QDataSource that draws data from a QIODevice.
This class encapsulates retrieving data from a QIODevice (such as a QFile).
Constructs a QIODeviceSource from the QIODevice device. The QIODevice must be dynamically allocated, becomes owned by the QIODeviceSource, and will be deleted when the QIODeviceSource is destroyed. buffer_size determines the size of buffering to use between asynchronous operations. The higher the buffer_size, the more efficient, but the less interleaved the operation will be with other processing.
QIODeviceSource::~QIODeviceSource | ( | ) |
Destroys the QIODeviceSource, deleting the QIODevice from which it was constructed.
QIODeviceSource::~QIODeviceSource | ( | ) |
void QIODeviceSource::enableRewind | ( | bool | on | ) | [virtual] |
If on is set to TRUE then rewinding is enabled. No special action is taken. If on is set to FALSE then rewinding is disabled.
Reimplementado de QDataSource.
void QIODeviceSource::enableRewind | ( | bool | ) | [virtual] |
If this function is called with on set to TRUE, and rewindable() is TRUE, then the data source must take measures to allow the rewind() function to subsequently operate as described. If rewindable() is FALSE, the function should call QDataSource::enableRewind(), which aborts with a qFatal() error.
For example, a network connection may choose to use a disk cache of input only if rewinding is enabled before the first buffer-full of data is discarded, returning FALSE in rewindable() if that first buffer is discarded.
Reimplementado de QDataSource.
int QIODeviceSource::readyToSend | ( | ) | [virtual] |
Ready until end-of-file.
Implementa QDataSource.
int QIODeviceSource::readyToSend | ( | ) | [virtual] |
The data source should return a value indicating how much data it is ready to provide. This may be 0. If the data source knows it will never be able to provide any more data (until after a rewind()), it may return -1.
Implementa QDataSource.
void QIODeviceSource::rewind | ( | ) | [virtual] |
This function rewinds the data source. This may only be called if enableRewind(TRUE) has been previously called.
Reimplementado de QDataSource.
void QIODeviceSource::rewind | ( | ) | [virtual] |
Calls reset() on the QIODevice.
Reimplementado de QDataSource.
bool QIODeviceSource::rewindable | ( | ) | const [virtual] |
This function should return TRUE if the data source can be rewound.
The default returns FALSE.
Reimplementado de QDataSource.
bool QIODeviceSource::rewindable | ( | ) | const [virtual] |
All QIODeviceSource's are rewindable.
Reimplementado de QDataSource.
Reads a block of data and sends up to n bytes to the sink.
Implementa QDataSource.
This function is called to extract data from the source, by sending it to the given data sink. The count will be no more than the amount indicated by the most recent call to readyToSend(). The source must use all the provided data, and the sink will be prepared to accept at least this much data.
Implementa QDataSource.