[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'Classes' (#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 1128

type TReader = class(TFiler)

protected

  function Error(); virtual;

  

Calls an installed error handler and passes it Message

  function FindMethod(); virtual;

  

Return the address of a published method.

  procedure ReadProperty();

  

Read and process a property name

  procedure ReadPropValue();

  

Reads a property value for PropInfo.

  procedure PropertyError;

  

Skips a property value and raises an exception.

  procedure ReadData();

  

Reads the components data after it has been created.

  property PropName: String; [r]

  

Name of the property being read at this moment.

  property CanHandleExceptions: Boolean; [r]

  

Indicates whether the reader is handling exceptions at this stage.

  function CreateDriver(); virtual;

public

  constructor Create();

  

Creates a new reader class

  destructor Destroy; override;

  

Destroys a reader class.

  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.

  function NextValue;

  

Returns the type of the next value.

  procedure Read(); virtual;

  

Read raw data from stream

  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 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 ReadVariant;

  

Read a variant from the stream

  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 OnReadStringProperty: TReadWriteStringPropertyEvent; [rw]

  

Handler for translating strings when read from the stream.

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.

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.

The latest version of this document can be found at lazarus-ccr.sourceforge.net.