Indy 9 | Content | Index | Reference

TIdMessageEncoderList
Hierarchy, Methods, See Also, Unit: IdMessageCoder
Container for registered encoder classes, with methods to create, access, and release registered encoder classes.

    TIdMessageEncoderList = class(TObject)

Unit
IdMessageCoder
Description
TIdMessageEncoderList is a TObject descendant that is a container for registered encoder classes. TIdMessageEncoderList provides methods to create, access, and release registered encoder class instances.

The RegisterEncoder class method is used to register new encoder classes. RegisterEncoder is called in the initialization section of Units that contain an encoder class, like IdMessageCoder.pas, IdMessageCoderMIME.pas, IdMessageCoderUUE.pas, and IdMessageCoderXXE.pas.

The class method ByName is used to access an existing class instance in the container.

TIdMessageEncoderList.ByName
TIdMessageEncoderList, See Also
Retrieves information about a registered encoder class using a specified name.

    class function ByName(const AName: string): TIdMessageEncoderInfo;

Parameters
const AName: string
Name of the registered encoder class to be retrieved.
Return Value
TIdMessageEncoderInfo - Registerd encoder class that matxh the specified name.
Description
ByName is a TIdMessageEncoderInfo class function in TIdMessageEncoderList that retrieves information about a registered encoder class using the name specified in AName. If a registered encoder cannot be located with the specified name, an EIdException exception is raised with the constant message RSMessageEncoderNotFound the value in AName.

ByName is used by TIdMessage and TIdMessageParts when updating the value of the AttachmentEncoding property.

TIdMessageEncoderList.Create
TIdMessageEncoderList, See Also
Constructor for the object instance.

    constructor Create;

Description
Create is the Constructor for the object instance, and relies on the inherited Create method. Create also initializes the internal list used to store registered message encoder class instances.

TIdMessageEncoderList.Destroy
TIdMessageEncoderList, See Also
Frees the object instance.

    destructor Destroy; override;

Description
Destroy is the Destructor fo r the object instance. Destroy frees each registerd encoder class instance in the internal list, and list prior to calling the inherited Destroy method.

TIdMessageEncoderList.RegisterEncoder
TIdMessageEncoderList, See Also
Registers and stores information about encoder class types.

    class procedure RegisterEncoder(const AMessageEncoderName: string; AMessageEncoderInfo: TIdMessageEncoderInfo);

Parameters
const AMessageEncoderName: string
Name to be associated with the registered encoder class.
AMessageEncoderInfo: TIdMessageEncoderInfo
Information about the registered encoder class.
Description
RegisterEncoder is a class procedure in TIdMessageEncoderList that provides a mechanism for registering and storing information about encoder class types.

RegisterEncoder checks to insure that the list for registered encoder classed has be initialized to a valid TIdMessageEncoderList instance. RegisterEncoder adds the class information in AMessageEncoderInfo to the list, and associates the name in AName with the registered class type.

RegisterEncoder is called from the initialization section of the Unit that contains the class type, like IdMessageCoder.pas, IdMessageCoderMIME.pas, IdMessageCoderUUE.pas, and IdMessageCoderXXE.pas.

Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.