Class TTextReader
Unit
CastleClassUtils
Declaration
type TTextReader = class(TTextReaderWriter)
Description
Read any TStream like a text file. Includes comfortable Readln routine to read line by line (lines may be terminated in any OS convention). Includes comfortable Read to read next non-whitespace characters, ReadInteger to read next integer and such.
Do not use the underlying stream once you started reading it with this class. We will move the position within this stream ourselves.
Hierarchy
Overview
Methods
Description
Methods
 |
constructor Create(const URL: string); overload; |
Download and open a file.
|
 |
function Readln: string; |
Read next line from Stream. Returned string does not contain any end-of-line characters.
|
 |
function Read: string; |
Read the next string of non-whitespace characters. This skips any whitespace (including newlines) we currently see, then reads all non-whitespace characters as far as it can. It does not consume any whitespace characters after the string.
Returns empty string if and only if the stream ended. Otherwise, returns the read non-whitespace characters.
|
 |
function ReadInteger: Integer; |
Read the next Integer from stream. Reads next string of non-whitespace characters, like Read, and then converts it to Integer.
Exceptions raised
EConvertError
- If the next non-whitespace string cannot be converted to Integer. This includes situations when stream ended (Read would return empty string in this case).
|
 |
function ReadSingle: Single; |
Read the next Single value from stream. Reads next string of non-whitespace characters, like Read, and then converts it to Single.
Exceptions raised
EConvertError
- If the next non-whitespace string cannot be converted to Single. This includes situations when stream ended (Read would return empty string in this case).
|
 |
function ReadVector3Single: TVector3Single; |
Read the next vector from a stream, simply reading 3 Single values in sequence.
Exceptions raised
EConvertError
- If one of the components cannot be converted to Single, or when stream ended prematurely.
|
 |
function Eof: boolean; |
|
Generated by PasDoc 0.14.0.
|