Internet Direct (Indy)
Home
PreviousUpNext
TIdMessageDecoderList.CheckForStart Method

Determines the registered decoder class instance to be used for an RFC 2822 message part.

Pascal
class function CheckForStart(
    ASender: TIdMessage; 
    const ALine: string
): TIdMessageDecoder;
Parameters 
Description 
ASender 
Message to be associated with the decoder class instance.
 
ALine 
Text to be examined to determine the decoder needed for the message part. 

TIdMessageDecoder - Decoder class instance for the message part.

CheckForStart is a TIdMessageDecoder class function used to determine the registered decoder class instance to be applied when decoding the RFC 822 message part. 

CheckForStart examines the global list of registered decoder classes in GMessageDecoderList, and calls the TIdMessageDecoderInfo.CheckForStart method for each decoder class instance in the list. When a decoder class is found for the message part, the method exits and returns the TIdMessageDecoderInfo instance for the message part. If no decoder class is located for the message part, the return value for CheckForStart is Nil. 

ASender is the message instance to associate with the registered decoder class instance in the return value. 

ALine contains data to be examined when determining if the decoder class can be used for the message part containing the data in ALine. ALine generally represents the initial data in the message, like a MIME boundary marker or the initial values in a transfer encoded block. 

Use RegisterDecoder to add an instance of TIdMessageDecoderInfo or descendant classes to the global decoder list in GMessageDecoderList. 

CheckForStart calls the TIdMessageDecoderInfo.CheckForStart method, which is declared as an abstract virtual method. So CheckForStart will actually invoke the overridden method in method table for the descendant decoder class instances.

Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Website http://www.indyproject.org.
Post feedback to the Indy Documentation newsgroup.