Indy 9 | Content | Index | Reference

TIdMessageDecoderInfo
Hierarchy, Methods, See Also, Unit: IdMessageCoder
Represents information about registered decoder classes and detects coder usage for message part contents.

    TIdMessageDecoderInfo = class(TObject)

Unit
IdMessageCoder
Description
TIdMessageDecoderInfo is a TObject descendant that specifies the base class for representing information about registered decoder classes. TIdMessageDecoderInfo also provides a mechanism to detect when a decoder is suitable for use in decoding the contents of a message part, and returns a reference to the decoder class.

All methods in TIdMessageDecoderInfo are virtual. Descendant classes, like TIdMessageDecoderInfoMIME and TIdMessageDecoderInfoUUE, should implement the constructor and pertinent methods to provide support for specific encoding algorithms.

Instances of TIdMessageDecoderInfo and descendant classes are stored in a global TIdMessageDecoderList variable to indicate that the decoder class is registered and available for use with message parts.

TIdMessageDecoderInfo.CheckForStart
TIdMessageDecoderInfo, See Also
Specifies a method for retrieving a decoder class instance, and associating the decoder with a given message.

    function CheckForStart(ASender: TIdMessage; ALine: string): TIdMessageDecoder; virtual; abstract;

Parameters
ASender: TIdMessage
Message associated with the decoder instance.
ALine: string
Encoded message part content to be examined to determine the appropriate decoder class.
Return Value
TIdMessageDecoder - Decoder class instance to use for the message part.
Description
CheckForStart is an abstract virtual function in TIdMessageDecoderInfo that specifies a method for retrieving a decoder class instance, and associating the decoder class instance with a specific message.

ASender is the TIdMessage to be associated with the decoder class instance.

ALine is a line from the message part that will be examined to determine if the registered decoder can be used for decoding the message part.

Descendant classes, like TIdMessageDecoderInfoMIME and TIdMessageDecoderInfoUUE, must implement comparisons to determine if ALine contains a marker signifying the start of a block using the specific encoding algorithm. If ALine contains the appropriate signature, a message decoder instance is created for ASender in the function return value. Otherwise the function return value is Nil.

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

    constructor Create; virtual;

Description
Create is the constructor for the object instance. Create is a virtual constructor that can be re-implemented in descendant classes to provide the capability needed for the derived class instance.

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