Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

QStringBuffer Class Reference

Inheritance diagram for QStringBuffer:

Inheritance graph
[legend]
Collaboration diagram for QStringBuffer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 QStringBuffer (QString *str)
 ~QStringBuffer ()
bool open (int m)
void close ()
void flush ()
Offset size () const
Offset at () const
bool at (Offset pos)
Q_LONG readBlock (char *p, Q_ULONG len)
Q_LONG writeBlock (const char *p, Q_ULONG len)
int getch ()
int putch (int ch)
int ungetch (int ch)

Protected Attributes

QStrings

Private Member Functions

 QStringBuffer (const QStringBuffer &)
QStringBufferoperator= (const QStringBuffer &)

Constructor & Destructor Documentation

QStringBuffer::QStringBuffer QString str  ) 
 

Definition at line 310 of file qtextstream.cpp.

References s.

QStringBuffer::~QStringBuffer  ) 
 

Definition at line 315 of file qtextstream.cpp.

QStringBuffer::QStringBuffer const QStringBuffer  )  [private]
 


Member Function Documentation

bool QStringBuffer::at Offset  pos  )  [virtual]
 

Virtual function that sets the I/O device position to pos. Returns TRUE if the position was successfully set, i.e. pos is within range; otherwise returns FALSE.

See also:
size()

Reimplemented from QIODevice.

Definition at line 370 of file qtextstream.cpp.

References FALSE, QIODevice::ioIndex, QIODevice::isOpen(), QString::length(), qWarning(), s, and TRUE.

QIODevice::Offset QStringBuffer::at  )  const [virtual]
 

Virtual function that returns the current I/O device position.

This is the position of the data read/write head of the I/O device.

See also:
size()

Reimplemented from QIODevice.

Definition at line 365 of file qtextstream.cpp.

References QIODevice::ioIndex.

void QStringBuffer::close void   )  [virtual]
 

Closes the I/O device.

This virtual function must be reimplemented by all subclasses.

See also:
open()

Implements QIODevice.

Definition at line 348 of file qtextstream.cpp.

References IO_Direct, QIODevice::ioIndex, QIODevice::isOpen(), and QIODevice::setFlags().

void QStringBuffer::flush  )  [virtual]
 

Flushes an open I/O device.

This virtual function must be reimplemented by all subclasses.

Implements QIODevice.

Definition at line 356 of file qtextstream.cpp.

int QStringBuffer::getch  )  [virtual]
 

Reads a single byte/character from the I/O device.

Returns the byte/character read, or -1 if the end of the I/O device has been reached.

This virtual function must be reimplemented by all subclasses.

See also:
putch(), ungetch()

Implements QIODevice.

Definition at line 449 of file qtextstream.cpp.

References IO_ReadError, QIODevice::ioIndex, QIODevice::isOpen(), QIODevice::isReadable(), QString::length(), qWarning(), s, QIODevice::setStatus(), and QString::unicode().

bool QStringBuffer::open int  m  )  [virtual]
 

Opens the I/O device using the specified mode. Returns TRUE if the device was successfully opened; otherwise returns FALSE.

The mode parameter mode must be an OR'ed combination of the following flags. Mode flags Meaning IO_Raw specifies raw (unbuffered) file access. IO_ReadOnly opens a file in read-only mode. IO_WriteOnly opens a file in write-only mode. IO_ReadWrite opens a file in read/write mode. IO_Append sets the file index to the end of the file. IO_Truncate truncates the file. IO_Translate enables carriage returns and linefeed translation for text files under MS-DOS, Windows and Macintosh. On Unix systems this flag has no effect. Use with caution as it will also transform every linefeed written to the file into a CRLF pair. This is likely to corrupt your file if you write write binary data. Cannot be combined with IO_Raw.

This virtual function must be reimplemented by all subclasses.

See also:
close()

Implements QIODevice.

Definition at line 320 of file qtextstream.cpp.

References FALSE, IO_Append, IO_Open, IO_Truncate, QIODevice::ioIndex, QIODevice::isOpen(), QString::length(), qWarning(), s, QIODevice::setMode(), QIODevice::setState(), QIODevice::setStatus(), TRUE, and QString::truncate().

QStringBuffer& QStringBuffer::operator= const QStringBuffer  )  [private]
 

int QStringBuffer::putch int  ch  )  [virtual]
 

Writes the character ch to the I/O device.

Returns ch, or -1 if an error occurred.

This virtual function must be reimplemented by all subclasses.

See also:
getch(), ungetch()

Implements QIODevice.

Definition at line 468 of file qtextstream.cpp.

References writeBlock().

Q_LONG QStringBuffer::readBlock char *  p,
Q_ULONG  len
[virtual]
 

Reads at most maxlen bytes from the I/O device into data and returns the number of bytes actually read.

This function should return -1 if a fatal error occurs and should return 0 if there are no bytes to read.

The device must be opened for reading, and data must not be 0.

This virtual function must be reimplemented by all subclasses.

See also:
writeBlock() isOpen() isReadable()

Implements QIODevice.

Definition at line 393 of file qtextstream.cpp.

References IO_ReadError, QIODevice::ioIndex, QIODevice::isOpen(), QIODevice::isReadable(), QString::length(), qWarning(), s, QIODevice::setStatus(), and QString::unicode().

QIODevice::Offset QStringBuffer::size  )  const [virtual]
 

Virtual function that returns the size of the I/O device.

See also:
at()

Implements QIODevice.

Definition at line 360 of file qtextstream.cpp.

References QString::length(), and s.

int QStringBuffer::ungetch int  ch  )  [virtual]
 

Puts the character ch back into the I/O device and decrements the index position if it is not zero.

This function is normally called to "undo" a getch() operation.

Returns ch, or -1 if an error occurred.

This virtual function must be reimplemented by all subclasses.

See also:
getch(), putch()

Implements QIODevice.

Definition at line 477 of file qtextstream.cpp.

References QIODevice::ioIndex, QIODevice::isOpen(), QIODevice::isReadable(), and qWarning().

Q_LONG QStringBuffer::writeBlock const char *  p,
Q_ULONG  len
[virtual]
 

Writes len bytes from data to the I/O device and returns the number of bytes actually written.

This function should return -1 if a fatal error occurs.

This virtual function must be reimplemented by all subclasses.

See also:
readBlock()

Implements QIODevice.

Definition at line 420 of file qtextstream.cpp.

References QIODevice::ioIndex, QIODevice::isOpen(), QIODevice::isWritable(), qWarning(), QString::replace(), and s.

Referenced by putch().


Member Data Documentation

QString* QStringBuffer::s [protected]
 

Definition at line 302 of file qtextstream.cpp.

Referenced by at(), getch(), open(), QStringBuffer(), readBlock(), size(), and writeBlock().


The documentation for this class was generated from the following file:
Generated on Sat Nov 5 17:49:03 2005 for OPIE by  doxygen 1.4.2