Qt 4.8
Static Public Functions | List of all members
QNonContiguousByteDeviceFactory Class Reference

Creates a QNonContiguousByteDevice out of a QIODevice, QByteArray etc. More...

#include <qnoncontiguousbytedevice_p.h>

Static Public Functions

static QNonContiguousByteDevicecreate (QIODevice *device)
 Create a QNonContiguousByteDevice out of a QIODevice. More...
 
static QNonContiguousByteDevicecreate (QByteArray *byteArray)
 Create a QNonContiguousByteDevice out of a QByteArray. More...
 
static QNonContiguousByteDevicecreate (QSharedPointer< QRingBuffer > ringBuffer)
 Create a QNonContiguousByteDevice out of a QRingBuffer. More...
 
static QIODevicewrap (QNonContiguousByteDevice *byteDevice)
 Wrap the byteDevice (possibly again) into a QIODevice. More...
 

Detailed Description

Creates a QNonContiguousByteDevice out of a QIODevice, QByteArray etc.

Since
4.6
Attention
Module: QtCore
See also
QNonContiguousByteDevice
Warning
This function is not part of the public interface.

Definition at line 89 of file qnoncontiguousbytedevice_p.h.

Functions

◆ create() [1/3]

QNonContiguousByteDevice * QNonContiguousByteDeviceFactory::create ( QIODevice device)
static

Create a QNonContiguousByteDevice out of a QIODevice.

For QFile, QBuffer and all other QIoDevice, sequential or not.

Warning
This function is not part of the public interface.

Definition at line 517 of file qnoncontiguousbytedevice.cpp.

Referenced by QNetworkAccessBackend::createUploadByteDevice().

518 {
519  // shortcut if it is a QBuffer
520  if (QBuffer* buffer = qobject_cast<QBuffer*>(device)) {
521  return new QNonContiguousByteDeviceBufferImpl(buffer);
522  }
523 
524  // ### FIXME special case if device is a QFile that supports map()
525  // then we can actually deal with the file without using read/peek
526 
527  // generic QIODevice
528  return new QNonContiguousByteDeviceIoDeviceImpl(device); // FIXME
529 }
The QBuffer class provides a QIODevice interface for a QByteArray.
Definition: qbuffer.h:57

◆ create() [2/3]

QNonContiguousByteDevice * QNonContiguousByteDeviceFactory::create ( QByteArray byteArray)
static

Create a QNonContiguousByteDevice out of a QByteArray.

Warning
This function is not part of the public interface.

Definition at line 548 of file qnoncontiguousbytedevice.cpp.

◆ create() [3/3]

QNonContiguousByteDevice * QNonContiguousByteDeviceFactory::create ( QSharedPointer< QRingBuffer ringBuffer)
static

Create a QNonContiguousByteDevice out of a QRingBuffer.

Warning
This function is not part of the public interface.

Definition at line 536 of file qnoncontiguousbytedevice.cpp.

◆ wrap()

QIODevice * QNonContiguousByteDeviceFactory::wrap ( QNonContiguousByteDevice byteDevice)
static

Wrap the byteDevice (possibly again) into a QIODevice.

Warning
This function is not part of the public interface.

Definition at line 560 of file qnoncontiguousbytedevice.cpp.

Referenced by QNetworkAccessFtpBackend::open().

561 {
562  // ### FIXME if it already has been based on QIoDevice, we could that one out again
563  // and save some calling
564 
565  // needed for FTP backend
566 
567  return new QByteDeviceWrappingIoDevice(byteDevice);
568 }

The documentation for this class was generated from the following files: