Class TSimplePeekCharStream

Unit

Declaration

type TSimplePeekCharStream = class(TPeekCharStream)

Description

Read another stream, sequentially, always being able to back one character. This is a simplest non-abstract implementation of the TPeekCharStream class.

Source: base/castleclassutils.pas (line 359).

Hierarchy

Show Additional Members:

Overview

Methods

Protected function GetSize: Int64; override;
Protected procedure SetSize(NewSize: Longint); override;
Protected procedure UpdateLineColumn(const C: AnsiChar); overload;
Protected procedure UpdateLineColumn(const Buffer; const BufferCount: Integer); overload;
Public constructor Create(ASourceStream: TStream; AOwnsSourceStream: boolean);
Public destructor Destroy; override;
Public function Seek(const Offset: Int64; Origin: TSeekOrigin): Int64; override;
Public function Write(const Buffer; Count: Longint): Longint; override;
Public function ReadUpto(const EndingChars: TSetOfChars): AnsiString; virtual;
Protected function GetPosition: Int64; override;
Public function Read(var Buffer; Count: Longint): Longint; override;
Public function PeekChar: Integer; override;
Public function ReadChar: Integer; override;

Properties

Public property SourceStream: TStream read FSourceStream;
Public property OwnsSourceStream: boolean read FOwnsSourceStream write FOwnsSourceStream;
Public property Line: Int64 read FLine;
Public property Column: Int64 read FColumn;

Description

Methods

Protected function GetSize: Int64; override;

This item is declared in ancestor TPeekCharStream.

.

Returns

SourceStream.Size

Source: base/castleclassutils.pas (line 290).

Protected procedure SetSize(NewSize: Longint); override;

This item is declared in ancestor TPeekCharStream.

This stream doesn't support setting size. (All other versions of SetSize also call this.)

Exceptions raised
EStreamNotImplementedSetSize
Always.

Source: base/castleclassutils.pas (line 295).

Protected procedure UpdateLineColumn(const C: AnsiChar); overload;

This item is declared in ancestor TPeekCharStream.

This item has no description.

Source: base/castleclassutils.pas (line 300).

Protected procedure UpdateLineColumn(const Buffer; const BufferCount: Integer); overload;

This item is declared in ancestor TPeekCharStream.

This item has no description.

Source: base/castleclassutils.pas (line 301).

Public constructor Create(ASourceStream: TStream; AOwnsSourceStream: boolean);

This item is declared in ancestor TPeekCharStream.

This item has no description.

Source: base/castleclassutils.pas (line 303).

Public destructor Destroy; override;

This item is declared in ancestor TPeekCharStream.

This item has no description.

Source: base/castleclassutils.pas (line 304).

Public function Seek(const Offset: Int64; Origin: TSeekOrigin): Int64; override;

This item is declared in ancestor TPeekCharStream.

This stream doesn't support seeking. (SetPosition and all other versions of Seek also call this.)

Exceptions raised
EStreamNotImplementedSeek
Always.

Source: base/castleclassutils.pas (line 309).

Public function Write(const Buffer; Count: Longint): Longint; override;

This item is declared in ancestor TPeekCharStream.

This stream doesn't support writing. (WriteBuffer also calls this.)

Exceptions raised
EStreamNotImplementedWrite
Always.

Source: base/castleclassutils.pas (line 314).

Public function ReadUpto(const EndingChars: TSetOfChars): AnsiString; virtual;

This item is declared in ancestor TPeekCharStream.

Read characters, until one of EndingChars (or end of stream) is found. The ending character is not "consumed" from the stream. The Result is guaranteed to not contain any char from EndingChars.

Source: base/castleclassutils.pas (line 343).

Protected function GetPosition: Int64; override;

This item has no description.

Source: base/castleclassutils.pas (line 365).

Public function Read(var Buffer; Count: Longint): Longint; override;

This item has no description.

Source: base/castleclassutils.pas (line 367).

Public function PeekChar: Integer; override;

This item has no description. Showing description inherited from TPeekCharStream.PeekChar.

Peek next character. Returns the next character without making it "already read", so the next call to Read or ReadBuffer will return this char. Subsequent calls to PeekChar (without any Read/ReadBuffer between) will also return the same character.

Returns -1 if stream ended, otherwise returns Ord or given char.

This may call SourceStream.Read, and any exceptions that may be raised in SourceStream.Read are propagated higher from this method.

Source: base/castleclassutils.pas (line 368).

Public function ReadChar: Integer; override;

This item has no description. Showing description inherited from TPeekCharStream.ReadChar.

Read next character. A shortcut for Read(c, 1), but it returns -1 if end of stream is reached. So it's consistent with PeekChar. Sometimes it's also more comfortable, and it's a little faster.

Source: base/castleclassutils.pas (line 369).

Properties

Public property SourceStream: TStream read FSourceStream;

This item is declared in ancestor TPeekCharStream.

Underlying stream.

Source: base/castleclassutils.pas (line 317).

Public property OwnsSourceStream: boolean read FOwnsSourceStream write FOwnsSourceStream;

This item is declared in ancestor TPeekCharStream.

Should we free underlying SourceStream at destruction.

Source: base/castleclassutils.pas (line 320).

Public property Line: Int64 read FLine;

This item is declared in ancestor TPeekCharStream.

Line number in the file (counting from 1).

Source: base/castleclassutils.pas (line 350).

Public property Column: Int64 read FColumn;

This item is declared in ancestor TPeekCharStream.

Column number in the file (counting from 1).

Source: base/castleclassutils.pas (line 353).


Generated by PasDoc 0.17.0.snapshot.