Sign in Join
FPDoc Onlineexperiment

TResources.FindReader function

Member of TResourcespublicIn unit resource

Searches for a suitable resource reader

Declaration

pascal
class function FindReader(aStream: TStream; aExtension: string)
: TAbstractResourceReader
class function FindReader(aStream: TStream): TAbstractResourceReader

Arguments

aStream

The stream to be probed

aExtension

The extension the reader is registered for

Function result

An instance of a TAbstractResourceReader descendant.

Description

This method tries to find a resource reader able to read the stream passed as parameter.

If an extension is specified, only readers matching that extension are tried. The extension is case-insensitive and includes the leading dot, unless the empty string is passed (which means "no extension", e.g. a unix executable, which doesn't have an extension).

If a suitable reader is found, an instance of that reader is returned.

To make a resource reader class known, add that resource reader unit to the uses clause of your program.

Errors

If no suitable reader is found, an EResourceReaderNotFoundException exception is raised.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.