#include <InStreams.h>
Inheritance diagram for InText:
Public Member Functions | |
InText () | |
void | reset () |
Protected Member Functions | |
virtual bool | isEof (const PhysicalInStream &stream) const |
virtual void | readChar (char &d, PhysicalInStream &stream) |
virtual void | readUChar (unsigned char &d, PhysicalInStream &stream) |
virtual void | readShort (short &d, PhysicalInStream &stream) |
virtual void | readUShort (unsigned short &d, PhysicalInStream &stream) |
virtual void | readInt (int &d, PhysicalInStream &stream) |
virtual void | readUInt (unsigned int &d, PhysicalInStream &stream) |
virtual void | readLong (long &d, PhysicalInStream &stream) |
virtual void | readULong (unsigned long &d, PhysicalInStream &stream) |
virtual void | readFloat (float &d, PhysicalInStream &stream) |
virtual void | readDouble (double &d, PhysicalInStream &stream) |
virtual void | readString (char *d, PhysicalInStream &stream) |
virtual void | readEndl (PhysicalInStream &stream) |
virtual bool | isWhitespace () |
virtual void | skipWhitespace (PhysicalInStream &stream) |
virtual void | nextChar (PhysicalInStream &stream) |
virtual void | readData (void *p, int size, PhysicalInStream &stream) |
Protected Attributes | |
char | theChar |
Private Attributes | |
char | buf [200] |
bool | eof |
Definition at line 293 of file InStreams.h.
InText::InText | ( | ) | [inline] |
virtual bool InText::isEof | ( | const PhysicalInStream & | stream | ) | const [inline, protected, virtual] |
The function returns whether the end of stream has been reached. If this function returns false, "theChar" is valid, otherwise it is not.
stream | The stream. |
Implements StreamReader.
Definition at line 320 of file InStreams.h.
References eof.
Referenced by InConfig::create(), InConfig::nextChar(), readEndl(), readString(), InConfig::skipComment(), InConfig::skipLine(), InConfig::skipWhitespace(), and skipWhitespace().
bool InText::isWhitespace | ( | ) | [protected, virtual] |
The function determines whether the current character is a whitespace.
Reimplemented in InConfig.
Definition at line 58 of file InStreams.cpp.
References theChar.
Referenced by InConfig::isWhitespace(), readString(), InConfig::skipWhitespace(), and skipWhitespace().
virtual void InText::nextChar | ( | PhysicalInStream & | stream | ) | [inline, protected, virtual] |
The function reads the next character from the stream.
Reimplemented in InConfig.
Definition at line 438 of file InStreams.h.
References eof, PhysicalInStream::getEof(), PhysicalInStream::readFromStream(), and theChar.
Referenced by InConfig::nextChar(), InTextMessage::readAll(), readEndl(), readString(), and skipWhitespace().
virtual void InText::readChar | ( | char & | d, | |
PhysicalInStream & | stream | |||
) | [inline, protected, virtual] |
reads a character from a stream
d | the data to read from the stream | |
stream | the stream to read from |
Implements StreamReader.
Definition at line 327 of file InStreams.h.
References buf, and readString().
Referenced by readData().
void InText::readData | ( | void * | p, | |
int | size, | |||
PhysicalInStream & | stream | |||
) | [protected, virtual] |
The function reads a number of bytes from the file.
p | The address the data is written to. Note that p must point to a memory area that is at least "size" bytes large. | |
size | The number of bytes to be read. | |
stream | The stream to read from. |
Implements StreamReader.
Definition at line 52 of file InStreams.cpp.
References readChar().
virtual void InText::readDouble | ( | double & | d, | |
PhysicalInStream & | stream | |||
) | [inline, protected, virtual] |
reads a double from a stream
d | the data to read from the stream | |
stream | the stream to read from |
Implements StreamReader.
Definition at line 400 of file InStreams.h.
References buf, and readString().
virtual void InText::readEndl | ( | PhysicalInStream & | stream | ) | [inline, protected, virtual] |
reads the 'end of line' from a stream and this time we mean it
stream | the stream to read from |
Implements StreamReader.
Definition at line 420 of file InStreams.h.
References isEof(), nextChar(), and theChar.
virtual void InText::readFloat | ( | float & | d, | |
PhysicalInStream & | stream | |||
) | [inline, protected, virtual] |
reads a float from a stream
d | the data to read from the stream | |
stream | the stream to read from |
Implements StreamReader.
Definition at line 392 of file InStreams.h.
References buf, and readString().
virtual void InText::readInt | ( | int & | d, | |
PhysicalInStream & | stream | |||
) | [inline, protected, virtual] |
reads a int from a stream
d | the data to read from the stream | |
stream | the stream to read from |
Implements StreamReader.
Definition at line 359 of file InStreams.h.
References buf, int(), and readString().
virtual void InText::readLong | ( | long & | d, | |
PhysicalInStream & | stream | |||
) | [inline, protected, virtual] |
reads a long from a stream
d | the data to read from the stream | |
stream | the stream to read from |
Implements StreamReader.
Definition at line 376 of file InStreams.h.
References buf, and readString().
virtual void InText::readShort | ( | short & | d, | |
PhysicalInStream & | stream | |||
) | [inline, protected, virtual] |
reads a short from a stream
d | the data to read from the stream | |
stream | the stream to read from |
Implements StreamReader.
Definition at line 343 of file InStreams.h.
References buf, and readString().
void InText::readString | ( | char * | d, | |
PhysicalInStream & | stream | |||
) | [protected, virtual] |
The function reads a string from a stream. It skips all whitespace characters, and then reads a sequence of non-whitespace characters to a buffer, until it again recognizes a whitespace.
d | The value that is read. Note that value must point to a memory area that is large enough to carry the string. | |
stream | the stream to read from |
Implements StreamReader.
Definition at line 37 of file InStreams.cpp.
References isEof(), isWhitespace(), nextChar(), skipWhitespace(), and theChar.
Referenced by InConfig::create(), readChar(), readDouble(), readFloat(), readInt(), readLong(), readShort(), readUChar(), readUInt(), readULong(), and readUShort().
virtual void InText::readUChar | ( | unsigned char & | d, | |
PhysicalInStream & | stream | |||
) | [inline, protected, virtual] |
reads a unsigned character from a stream
d | the data to read from the stream | |
stream | the stream to read from |
Implements StreamReader.
Definition at line 335 of file InStreams.h.
References buf, and readString().
virtual void InText::readUInt | ( | unsigned int & | d, | |
PhysicalInStream & | stream | |||
) | [inline, protected, virtual] |
reads a unsigned int from a stream
d | the data to read from the stream | |
stream | the stream to read from |
Implements StreamReader.
Definition at line 368 of file InStreams.h.
References buf, int(), and readString().
virtual void InText::readULong | ( | unsigned long & | d, | |
PhysicalInStream & | stream | |||
) | [inline, protected, virtual] |
reads a unsigned long from a stream
d | the data to read from the stream | |
stream | the stream to read from |
Implements StreamReader.
Definition at line 384 of file InStreams.h.
References buf, and readString().
virtual void InText::readUShort | ( | unsigned short & | d, | |
PhysicalInStream & | stream | |||
) | [inline, protected, virtual] |
reads a unsigned short from a stream
d | the data to read from the stream | |
stream | the stream to read from |
Implements StreamReader.
Definition at line 351 of file InStreams.h.
References buf, and readString().
void InText::reset | ( | void | ) | [inline] |
Resets theChar to be able to use the same instance of InText or InConfig more than once.
Definition at line 306 of file InStreams.h.
Referenced by MessageQueue::handleAllMessages(), MessageQueue::handleSpecificMessages(), InText(), and InMessage::resetReadPosition().
void InText::skipWhitespace | ( | PhysicalInStream & | stream | ) | [protected, virtual] |
The function skips the whitespace.
Reimplemented in InConfig.
Definition at line 63 of file InStreams.cpp.
References isEof(), isWhitespace(), and nextChar().
Referenced by readString().
char InText::buf[200] [private] |
A buffer to convert read strings.
Definition at line 296 of file InStreams.h.
Referenced by readChar(), readDouble(), readFloat(), readInt(), readLong(), readShort(), readUChar(), readUInt(), readULong(), and readUShort().
bool InText::eof [private] |
char InText::theChar [protected] |
The last character read.
Definition at line 312 of file InStreams.h.
Referenced by InConfig::isWhitespace(), isWhitespace(), nextChar(), InConfig::nextChar(), InTextMessage::readAll(), readEndl(), readString(), reset(), InConfig::skipComment(), InConfig::skipLine(), and InConfig::skipWhitespace().