#include <TextInputStream.h>
Public Types | |
| enum | EEncodingType { etAutoDetect = 0, etISO_8859_1 = 1, etUTF_16 = 2 } |
| enum | EEndianType { etLittleEndian = 0, etBigEndian = 1 } |
Public Member Functions | |
| TTextInputStream (IInputStream &rParentStream, EEncodingType eEncoding=etAutoDetect, EEndianType eEndian=etLittleEndian) | |
| TTextInputStream (const IString &rFileName, EEncodingType eEncoding=etAutoDetect, EEndianType eEndian=etLittleEndian) | |
| Retval | readLine (IString &rLine) const |
| Retval | readText (IString &rText) const |
| Retval | readText (IString &rText, Int iBlockSize, Int iExpectedStreamSize) const |
| EEndianType | getEndianType () const |
| EEncodingType | getEncodingType () const |
Protected Member Functions | |
| virtual | ~TTextInputStream () |
| virtual Int8 MQUALIFIER | readInt8 (bool *pError) const |
| virtual Int16 MQUALIFIER | readInt16 (bool *pError) const |
| virtual Int32 MQUALIFIER | readInt32 (bool *pError) const |
| virtual Int64 MQUALIFIER | readInt64 (bool *pError) const |
| virtual Uint16 MQUALIFIER | readUint16 (bool *pError) const |
| virtual Uint32 MQUALIFIER | readUint32 (bool *pError) const |
| virtual Uint64 MQUALIFIER | readUint64 (bool *pError) const |
| virtual Float32 MQUALIFIER | readFloat32 (bool *pError) const |
| virtual Float64 MQUALIFIER | readFloat64 (bool *pError) const |
| virtual bool MQUALIFIER | readBool (bool *pError) const |
| virtual Retval MQUALIFIER | readArray (IByteArray &rData) const |
| virtual Retval MQUALIFIER | readString (IString &rData) const |
| virtual Retval MQUALIFIER | read (char *pBuffer, Int iBufferSize, Int &rValidSize) const |
| virtual Int MQUALIFIER | readItem () const |
This is a special input stream filter to read text informations. The text can be read from any input stream or directly from a file. Following encodings are valid:
| TTextInputStream::TTextInputStream | ( | IInputStream & | rParentStream, |
| EEncodingType | eEncoding = etAutoDetect, |
||
| EEndianType | eEndian = etLittleEndian |
||
| ) |
Creates a TextInputStream filter using any input stream as source
| rParentStream | : Source stream |
| eEncoding | : Encoding of the text file (default is autodetection) |
| eEndian | : endian type (little or big endian). Default is little endian |
| TTextInputStream::TTextInputStream | ( | const IString & | rFileName, |
| EEncodingType | eEncoding = etAutoDetect, |
||
| EEndianType | eEndian = etLittleEndian |
||
| ) |
Creates a TextInputStream filter, using a file as source
| rFileName | : file name |
| eEncoding | : Encoding of the text file (default is autodetection) |
| eEndian | : endian type (little or big endian). Default is little endian |
| TTextInputStream::~TTextInputStream | ( | ) | [protected, virtual] |
Destroys the TextInputStream filter
| TTextInputStream::EEncodingType zeus::TTextInputStream::getEncodingType | ( | ) | const [inline] |
returns the encoding type
| TTextInputStream::EEndianType zeus::TTextInputStream::getEndianType | ( | ) | const [inline] |
returns the endian type
| Retval MQUALIFIER zeus::TTextInputStream::read | ( | char * | pBuffer, |
| Int | iBufferSize, | ||
| Int & | rValidSize | ||
| ) | const [inline, protected, virtual] |
Reimplemented from zeus::TFilterInputStream.
| Retval MQUALIFIER zeus::TTextInputStream::readArray | ( | IByteArray & | rData ) | const [inline, protected, virtual] |
Can not be used to read from text data
Reimplemented from zeus::TAbstractInputStream.
| bool MQUALIFIER zeus::TTextInputStream::readBool | ( | bool * | pError ) | const [inline, protected, virtual] |
Can not be used to read from text data
Reimplemented from zeus::TAbstractInputStream.
| Float32 MQUALIFIER zeus::TTextInputStream::readFloat32 | ( | bool * | pError ) | const [inline, protected, virtual] |
Can not be used to read from text data
Reimplemented from zeus::TAbstractInputStream.
| Float64 MQUALIFIER zeus::TTextInputStream::readFloat64 | ( | bool * | pError ) | const [inline, protected, virtual] |
Can not be used to read from text data
Reimplemented from zeus::TAbstractInputStream.
| Int16 MQUALIFIER zeus::TTextInputStream::readInt16 | ( | bool * | pError ) | const [inline, protected, virtual] |
Can not be used to read from text data
Reimplemented from zeus::TAbstractInputStream.
| Int32 MQUALIFIER zeus::TTextInputStream::readInt32 | ( | bool * | pError ) | const [inline, protected, virtual] |
Can not be used to read from text data
Reimplemented from zeus::TAbstractInputStream.
| Int64 MQUALIFIER zeus::TTextInputStream::readInt64 | ( | bool * | pError ) | const [inline, protected, virtual] |
Can not be used to read from text data
Reimplemented from zeus::TAbstractInputStream.
| Int8 MQUALIFIER zeus::TTextInputStream::readInt8 | ( | bool * | pError ) | const [inline, protected, virtual] |
Can not be used to read from text data
Reimplemented from zeus::TAbstractInputStream.
| Int MQUALIFIER zeus::TTextInputStream::readItem | ( | ) | const [inline, protected, virtual] |
Reimplemented from zeus::TFilterInputStream.
| Retval TTextInputStream::readLine | ( | IString & | rLine ) | const |
Reads a text line into the string buffer
| rLine | : returns parameter containing a line of text |
| Retval MQUALIFIER zeus::TTextInputStream::readString | ( | IString & | rData ) | const [inline, protected, virtual] |
Can not be used to read from text data
Reimplemented from zeus::TAbstractInputStream.
| Retval TTextInputStream::readText | ( | IString & | rText, |
| Int | iBlockSize, | ||
| Int | iExpectedStreamSize | ||
| ) | const |
Reads the whole text in one step
| rText | : Stream as text (Unicode or Ansi) |
| iBlockSize | : Size of the block to read from stream. If you are using network communication you should use the packet size here |
| iExpectedStreamSize | : Expected size of the file. If the expeced size is too small it will be increased dynamically, but this might slow down the performance. |
| RET_NOERROR | : Text read and returned |
| RET_REQUEST_FAILED | : Could not open the stream |
| Retval zeus::TTextInputStream::readText | ( | IString & | rText ) | const [inline] |
returns the text of the whole buffer using some standard settings
| rText | : Stream as text (Unicode or Ansi) |
| RET_NOERROR | : Text read and returned |
| RET_REQUEST_FAILED | : Could not open the stream |
| Uint16 MQUALIFIER zeus::TTextInputStream::readUint16 | ( | bool * | pError ) | const [inline, protected, virtual] |
Can not be used to read from text data
Reimplemented from zeus::TAbstractInputStream.
| Uint32 MQUALIFIER zeus::TTextInputStream::readUint32 | ( | bool * | pError ) | const [inline, protected, virtual] |
Can not be used to read from text data
Reimplemented from zeus::TAbstractInputStream.
| Uint64 MQUALIFIER zeus::TTextInputStream::readUint64 | ( | bool * | pError ) | const [inline, protected, virtual] |
Can not be used to read from text data
Reimplemented from zeus::TAbstractInputStream.