Home · Modules · All Classes · All Namespaces
Public Member Functions | Protected Member Functions | List of all members
Tp::IODevice Class Reference

The IODevice class represents a buffer with independent read-write. More...

#include <TelepathyQt/io-device.h>

Inherits QIODevice.

Public Member Functions

 IODevice (QObject *parent=0)
 
 ~IODevice ()
 
bool isSequential () const
 
qint64 bytesAvailable () const
 

Protected Member Functions

qint64 readData (char *data, qint64 maxSize)
 
qint64 writeData (const char *data, qint64 maxSize)
 

Detailed Description

The IODevice class represents a buffer with independent read-write.

QBuffer has one position pointer, so when we write data, the position pointer points to the end of the buffer and no bytes can be read.

This class is interesting for all CMs that use a library that accepts a QIODevice for file transfers.

Note: This class belongs to the service library.

Constructor & Destructor Documentation

◆ IODevice()

Tp::IODevice::IODevice ( QObject *  parent = 0)
explicit

◆ ~IODevice()

Tp::IODevice::~IODevice ( )

Member Function Documentation

◆ isSequential()

bool Tp::IODevice::isSequential ( ) const

Returns the number of bytes that are available for reading.

Returns
the number of bytes that are available for reading.

◆ bytesAvailable()

qint64 Tp::IODevice::bytesAvailable ( ) const

◆ readData()

qint64 Tp::IODevice::readData ( char *  data,
qint64  maxSize 
)
protected

◆ writeData()

qint64 Tp::IODevice::writeData ( const char *  data,
qint64  maxSize 
)
protected

Writes the data to the buffer.

Writes up to maxSize bytes from data to the buffer. If maxSize is not a zero, emits readyRead() and bytesWritten() signals.

Parameters
dataThe data to write.
maxSizeThe number for bytes to write.
Returns
The number of bytes that were written.