Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

TextIStream Class Reference

Input stream. More...

#include <mtextstream.h>

Inheritance diagram for TextIStream:

IStream TextStream Stream List of all members.

Public Methods

virtual TextIStream & operator>> (char &ch)
virtual TextIStream & operator>> (int &value)
virtual TextIStream & operator>> (long &value)
virtual TextIStream & operator>> (float &value)
virtual TextIStream & operator>> (double &value)
virtual TextIStream & operator>> (String &buffer)
virtual uint readRawBytes (char *data, uint maxlen)
int readLine (String &linebuf)
TextIStream & read (char *p, int n)

Detailed Description

Input stream.

Definition at line 131 of file mtextstream.h.


Member Function Documentation

TextIStream & operator>> String   str [virtual]
 

Read a word from stream.

The word is delimited with a whitespace character. The function skips any whitespace character in front of the word. It does not, however, skip any whitespace after it.

Implements IStream.

Definition at line 422 of file mtextstream.cc.

TextIStream & operator>> double &    rValue [virtual]
 

Read double-precision floating-point value from stream.

Skips any whitespace in front of the value, for example " 42" or " \t\n42". Does not skip any whitespace after the value.

The following regular expression defines the number format: [+-]?[0-9]+(\.[0-9]*)?([Ee][+-]?[0-9]+)?

For example, values such as "42", "-42", "+42", "+42.12345", "0.123", "1.5E10", "4.2E+10", and "4.2E-10" are valid.

Strings such as "42.", "42E" are not valid.

Implements IStream.

Definition at line 293 of file mtextstream.cc.

References IODevice::atEnd(), checkDevice(), IODevice::getch(), and IODevice::ungetch().

TextIStream & operator>> float &    rValue [virtual]
 

Read floating-point value from stream.

Skips any whitespace in front of the value, for example " 42" or " \t\n42". Does not skip any whitespace after the value.

The following regular expression defines the number format: [+-]?[0-9]+(\.[0-9]*)?([Ee][+-]?[0-9]+)?

For example, values such as "42", "-42", "+42", "+42.12345", "0.123", "1.5E10", "4.2E+10", and "4.2E-10" are valid.

Strings such as "42.", "42E" are not valid.

Implements IStream.

Definition at line 404 of file mtextstream.cc.

TextIStream & operator>> long &    rValue [virtual]
 

Read long value from stream.

Implements IStream.

Definition at line 236 of file mtextstream.cc.

References IODevice::atEnd(), checkDevice(), IODevice::getch(), and IODevice::ungetch().

TextIStream & operator>> int &    rValue [virtual]
 

Read integer value from stream.

Implements IStream.

Definition at line 267 of file mtextstream.cc.

TextIStream & operator>> char &    rCh [virtual]
 

Read character from stream.

Implements IStream.

Definition at line 225 of file mtextstream.cc.

References checkDevice(), and IODevice::getch().

TextIStream & read char *    p,
int    n
 

Reads a word from stream.

Parameters:
p  Buffer for reading.
n  Length of the buffer.

Definition at line 434 of file mtextstream.cc.

References String::length().

int readLine String   linebuf
 

Reads line to given buffer.

Returns:
Number of bytes read (line length), or 0 if the file is at EOS or not open.

Definition at line 465 of file mtextstream.cc.

References String::append(), IODevice::atEnd(), String::empty(), IODevice::isOpen(), and IODevice::readLine().

uint readRawBytes char *    data,
uint    maxlen
[virtual]
 

Reads a raw byte block from stream.

Implements IStream.

Definition at line 451 of file mtextstream.cc.

References IODevice::readBlock().


The documentation for this class was generated from the following files:
Generated on Thu Feb 10 20:06:43 2005 for LibMagiC by doxygen1.2.18