Unit 'Classes' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#rtl]

TReader

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Generic reader object which reads component data from any given source.

Declaration

Source position: classesh.inc line 1871

type TReader = class(TFiler)

public

  constructor Create();

  

Creates a new reader class.

  destructor Destroy; override;

  

Destroys a reader class.

  procedure FlushBuffer; override;

  

Flush the buffer.

  procedure BeginReferences;

  

Initializes the component referencing mechanism.

  procedure CheckValue();

  

Raises an exception if the next value in the stream is not of type Value.

  procedure DefineProperty(); override;

  

Reads a user-defined property from the stream.

  procedure DefineBinaryProperty(); override;

  

Reads a user-defined binary property from the stream.

  function EndOfList;

  

Returns true if the stream contains an end-of-list marker.

  procedure EndReferences;

  

Finalizes the component referencing mechanism.

  procedure FixupReferences;

  

Tries to resolve all unresolved component references.

  procedure SkipValue;

  function NextValue;

  

Returns the type of the next value.

  procedure Read(); virtual;

  

Read raw data from stream.

  procedure ReadPrefix(); virtual;

  function ReadBoolean;

  

Reads a boolean from the stream.

  function ReadChar;

  

Reads a character from the stream.

  function ReadWideChar;

  

Read widechar from the stream.

  function ReadUnicodeChar;

  

Read Unicode character.

  procedure ReadCollection();

  

Reads a collection from the stream.

  function ReadComponent();

  

Starts reading a component from the stream.

  procedure ReadComponents();

  

Starts reading child components from the stream.

  function ReadFloat;

  

Reads a float from the stream.

  function ReadSingle;

  

Reads a single-type real from the stream.

  function ReadDouble;

  function ReadDate;

  

Reads a date from the stream.

  function ReadCurrency;

  

Read a currency value from the stream.

  function ReadIdent;

  

Reads an identifier from the stream.

  function ReadInteger;

  

Reads an integer from the stream.

  function ReadInt64;

  

Reads a 64-bit integer from the stream.

  function ReadSet();

  

Read a set value from the stream.

  procedure ReadListBegin;

  

Checks for the beginning of a list.

  procedure ReadListEnd;

  

Checks for the end of a list.

  function ReadRootComponent();

  

Starts reading a root component.

  function ReadComponentDeltaRes();

  function ReadVariant;

  

Read a variant from the stream.

  procedure ReadSignature;

  

Read stream signature from the stream.

  function ReadStr;

  function ReadString;

  

Reads a string from the stream.

  function ReadWideString;

  

Read a WideString value from the stream.

  function ReadUnicodeString;

  

Read a UnicodeString value from the stream.

  function ReadValue;

  

Reads the next value type from the stream.

  procedure CopyValue();

  

Copy a value to a writer.

  property Driver: TAbstractObjectReader; [r]

  

The driver in use for streaming the data.

  property Owner: TComponent; [rw]

  

Owner of the component being read.

  property Parent: TComponent; [rw]

  

Parent of the component being read.

  property OnError: TReaderError; [rw]

  

Handler called when an error occurs.

  property OnPropertyNotFound: TPropertyNotFoundEvent; [rw]

  

Handler for treating missing properties.

  property OnFindMethod: TFindMethodEvent; [rw]

  

Handler to find or change a method address.

  property OnSetMethodProperty: TSetMethodPropertyEvent; [rw]

  

Handler for setting method properties.

  property OnSetName: TSetNameEvent; [rw]

  

Handler called when setting a component name.

  property OnReferenceName: TReferenceNameEvent; [rw]

  

Handler called when another component is referenced.

  property OnAncestorNotFound: TAncestorNotFoundEvent; [rw]

  

Handler called when the ancestor component cannot be found.

  property OnCreateComponent: TCreateComponentEvent; [rw]

  

Handler called when a component needs to be created.

  property OnFindComponentClass: TFindComponentClassEvent; [rw]

  

Handler called when a component class reference needs to be found.

  property OnFindComponentClassEx: TFindComponentClassExEvent; [rw]

  property OnReadStringProperty: TReadWriteStringPropertyEvent; [rw]

  

Handler for translating strings when read from the stream.

  property RawMode: Boolean; [rw]

end;

Inheritance

TReader

  

Generic reader object which reads component data from any given source.

|

TFiler

  

Class responsible for streaming of components.

|

TObject

  

Base class of all classes.

Description

The TReader class is a reader class that implements generic component streaming capabilities, independent of the format of the data in the stream. It uses a driver class TAbstractObjectReader to do the actual reading of data. The interface of the TReader class should be identical to the interface in Delphi.

Note that the TReader design is such that it can read a single component from a stream. It will read all children of this component, but it is not designed to read multiple components in succession from one stream.

It should never be necessary to create an instance of this class directly. Instead, the TStream.ReadComponent call should be used.

See also

TFiler

  

Class responsible for streaming of components.

TWriter

  

Object to write component data to an arbitrary format.

TAbstractObjectReader

  

Abstract driver class to read stored component data.


Documentation generated on: Dec 24 2024