[Overview][Resource strings][Constants][Types][Classes][Index] Reference for unit 'resource' (#fcl-res)

TResources.RegisterReader

Registers a resource reader class

Declaration

Source position: resource.pp line 272

public class procedure TResources.RegisterReader(

  const aExtension: string;

  aClass: TResourceReaderClass

);

Arguments

aExtension

  

The extension for which the class must be registered

aClass

  

The TAbstractResourceReader descendant to register

Description

This class method registers a resource reader class.

When registered, a class is known to TResources class, and can be used by FindReader, LoadFromStream and LoadFromFile methods when probing.

Usually this method is called in the initialization section of the unit implementing a TAbstractResourceReader descendant.

A class can be registered multiple times, one for each extension it is able to read. Multiple class can be registered for the same extension (e.g. both a coff and a elf reader can be registered for the .o extension). The extension must include the leading dot unless the empty string is used (which means "no extension", e.g. a unix executable, which doesn't have an extension).

See also

TAbstractResourceReader

  

Base abstract resource reader class

TResources.FindReader

  

Searches for a suitable resource reader

TResources.LoadFromStream

  

Loads the contents of the object from a stream

TResources.LoadFromFile

  

Loads the contents of the object from a file


Documentation generated on: May 14 2021