FX::QBuffer Class Reference
[File type i/o devices]

#include <QBuffer.h>

Inheritance diagram for FX::QBuffer:

FX::QIODevice List of all members.

Detailed Description

An i/o device accessing memory (Qt compatible).

There's little more to say than that this class works with a QByteArray to provide an i/o device working directly with memory. It auto-extends the array if needed etc. It's also thread-safe so multiple threads can use the i/o device at once.

Note that QBuffer ignores CR/LF translation (IO_Translate). Anything dealing with files in TnFOX does though, so the conversion can be done then.

Note:
If you don't set a buffer, an internal one is created for you which is deleted on destruction or setBuffer(). If you set your own buffer, it is never deleted by QBuffer.

Differences from QBuffer

Since there is no reference counted sharing in TnFOX, buffer() and setBuffer() return and take references.

Definition at line 56 of file QBuffer.h.

Public Types

typedef FXfval Offset
 Default
 Unix
 MacOS
 MSDOS
 NoTranslation
 UTF8
 UTF16
 UTF16LE
 UTF32
 UTF32LE
enum  CRLFType { Default, Unix, MacOS, MSDOS }
enum  UnicodeType {
  NoTranslation, UTF8, UTF16, UTF16LE,
  UTF32, UTF32LE
}

Public Member Functions

 QBuffer (FXuval len=0, bool fastbuffer=false)
 QBuffer (QByteArray &buffer)
 ~QBuffer ()
bool isNull () const
QByteArraybuffer () const
void setBuffer (QByteArray &buffer)
virtual bool open (FXuint mode)
virtual void close ()
virtual void flush ()
virtual FXfval size () const
virtual void truncate (FXfval size)
virtual FXuval readBlock (char *data, FXuval maxlen)
virtual FXuval writeBlock (const char *data, FXuval maxlen)
virtual FXuval readBlockFrom (char *data, FXuval maxlen, FXfval pos)
virtual FXuval writeBlockTo (FXfval pos, const char *data, FXuval maxlen)
virtual int getch ()
virtual int putch (int c)
virtual int ungetch (int c)
FXuint flags () const
FXuint mode () const
FXuint state () const
CRLFType crlfFormat () const
void setCRLFFormat (CRLFType type)
UnicodeType unicodeTranslation () const
void setUnicodeTranslation (UnicodeType type)
bool isBuffered () const
bool isRaw () const
bool isTranslated () const
bool isUTF16Translated () const
bool isUTF32Translated () const
bool isReadable () const
bool isWriteable () const
bool isWritable () const
bool isReadWrite () const
bool isClosed () const
bool isInactive () const
bool isOpen () const
virtual bool isSynchronous () const
virtual FXfval at () const
virtual bool at (FXfval newpos)
virtual bool atEnd () const
virtual const FXACLpermissions () const
virtual void setPermissions (const FXACL &)
FXuval readBlock (FXuchar *data, FXuval maxlen)
FXuval writeBlock (const FXuchar *data, FXuval maxlen)
virtual FXuval readLine (char *data, FXuval maxlen)
FXuval readBlockFrom (FXuchar *data, FXuval maxlen, FXfval pos)
FXuval writeBlockTo (FXfval pos, const FXuchar *data, FXuval maxlen)
FXfval shredData (FXfval offset, FXfval len=(FXfval)-1)

Static Public Member Functions

static UnicodeType determineUnicodeType (FXuchar *data, FXuval len) throw ()
static FXuval applyCRLF (FXuchar *FXRESTRICT output, const FXuchar *FXRESTRICT input, FXuval outputlen, FXuval &inputlen, CRLFType crlftype=Default, UnicodeType utftype=NoTranslation)
static FXuval removeCRLF (FXuchar *FXRESTRICT output, const FXuchar *FXRESTRICT input, FXuval outputlen, FXuval &inputlen, UnicodeType utftype=NoTranslation)

Protected Member Functions

void setFlags (int f)
void setMode (int m)
void setState (int s)

Protected Attributes

FXfval ioIndex

Friends

FXAPI FXStreamoperator<< (FXStream &s, const QBuffer &i)
FXAPI FXStreamoperator>> (FXStream &s, QBuffer &i)
FXAPI FXStreamoperator<< (FXStream &s, QIODevice &i)
FXAPI FXStreamoperator>> (FXStream &s, QIODevice &i)


The documentation for this class was generated from the following file:
(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:37:35 2009 for TnFOX by doxygen v1.4.7