Skip to content

TAbstractResourceWriter

Base abstract resource writer class

Declaration

Source position: resource.pp line 313

type

  TAbstractResourceWriter = class
  protected
    function GetTree : TObject;
    function GetExtensions : string;
    function GetDescription : string;
    procedure Write;
  public
    constructor Create;
    property Extensions: string; {r}
    property Description: string; {r}
  end;

Description

This is the base class that represents a resource writer.

A resource writer is an object whose job is to write all resources contained in a TResources object to a stream in a specific format.

Typically, a TResources object invokes Write method of the resource writer when it wants the writer to write data to a stream.

Usually each resource writer registers itself with TResources class in the initialization section of the unit in which it is implemented: this way a TResources object can find it when it is asked to write itself to a file, and no writer was specified (the writer is found based on the extension of the file to write to).

Remark:

An object of this class should never be directly instantiated: use a descendant class instead.

Properties

Member Visibility Description
Description read only public The writer description
Extensions read only public The extensions of file types the writer is able to write

Methods

Member Visibility Description
Create public Creates a new writer object
GetDescription protected Returns the description of the writer
GetExtensions protected Returns the extensions the writer is registered for
GetTree protected Gets the internal resource tree of a TResources object
Write protected Writes resources to a stream

See also

Name Description
TResources A collection of resources
TAbstractResource Base abstract resource class
TAbstractResourceReader Base abstract resource reader class
TResResourceWriter .res resource writer
TCoffResourceWriter COFF resource writer
TElfResourceWriter ELF resource writer
TExternalResourceWriter External file resource writer