Discuss this help topic in SecureBlackbox Forum

TElMessagePartHandler.OnParse

TElMessagePartHandler     See also     


Filter: C#/Java  VB.NET  Pascal  C++  PHP  


OnParse is invoked during message parsing and gives possibility to perform additional handling of the current message part.

Declaration

[C#/Java]
    internal protected int OnParse(TElNativeStream Source, [in] AnsiString Boundary, [in] AnsiString HeaderCharset, [in] AnsiString BodyCharset, TElMessageParsingOptions AOptions, bool IgnoreHeaderNativeCharset, bool IgnoreBodyNativeCharset, bool bActivatePartHandlers, TElOnParseState State, int Item, ref bool bIsHandled, ref bool bStopParse);
    
    TElMessageParsingOptions = SmallInt;
    
    TElMessageParsingOptions represents a bit mask which contains zero or more bit flags as defined by TElMessageParsingOption

[VB.NET]
    Protected Friend Overridable Function OnParse(ByVal Source As TElNativeStream, ByVal Boundary As AnsiString, ByVal HeaderCharset As AnsiString, ByVal BodyCharset As AnsiString, ByVal AOptions As TElMessageParsingOptions, ByVal IgnoreHeaderNativeCharset As Boolean, ByVal IgnoreBodyNativeCharset As Boolean, ByVal bActivatePartHandlers As Boolean, ByVal State As TElOnParseState, ByVal Item As Integer, ByRef bIsHandled As Boolean, ByRef bStopParse As Boolean) As Integer
    
    TElMessageParsingOptions As SmallInt
    
    TElMessageParsingOptions represents a bit mask which contains zero or more bit flags as defined by TElMessageParsingOption

[Pascal]
    protected function OnParse(Source: TElNativeStream; const Boundary, HeaderCharset, BodyCharset: AnsiString; AOptions: TElMessageParsingOptions; IgnoreHeaderNativeCharset, IgnoreBodyNativeCharset, bActivatePartHandlers: Boolean; State: TElOnParseState; Item: Integer; var bIsHandled, bStopParse: Boolean): ELMIMERESULT;
    
    TElMessageParsingOptions = set of TElMessageParsingOption;

[PHP]
    not available

[C++]
    not available

Parameters

  • Source - source stream.
  • HeaderCharset - charset of the header.
  • BodyCharset - charset of the body.
  • Options - parsing options.
  • IgnoreHeaderNativeCharset - determines what charset must be applied to the message header.
    True - the one specified in HeaderCharset
    False - the one specified in message if it exists or specified in HeaderCharset if there is no charset specified in the message.
    Default value - False
  • IgnoreBodyNativeCharset - determines what charset must be applied to the message body.
    True - the one specified in BodyCharset
    False - the one specified in message if it exists or specified in BodyCharset if there is no charset specified in the message.
    Default value - False
  • bActivatePartHandlers - shows if handlers must be invoked automatically.
    True - if there is a handler determined for the part it will be invoked automatically on part processing.
    False - even if handler is determined it won't be invoked automatically.
    Default value - False
  • State - describes parsing event state.
  • Item - indicates index of the current element for pstAddressFieldItem, pstHeaderFieldItem, pstBodyPartBefore and pstBodyPartAfter states.
  • Boundary - current boundary value.
  • bIsHandled - True value shows that current event has been handled and parsing for current state has to be excluded from further handling. But final states (with suffix 'After') can not be excluded from handling.
  • bStopParse - True value shows that parsing must be interrupted. All further states except pstAfter will be skipped. pstAfter state is necessary for handler to be able to deallocate resources.

Return value

    Returns 0 (EL_OK) or 1 (EL_WARNING) on success, and Error otherwise.

Description

    Parameters Header, Source, HeaderCharset, BodyCharset, Options, IgnoreHeaderNativeCharset, IgnoreBodyNativeCharset correspond to ParseMessage method parameters.

    Note,Options enabling differs for VCL and .NET versions. To enable several options in .NET use bitwise OR operation, for example "mpoStoreStream | mpoLoadData | mpoCalcDataSize".

See also:     OnAssemble    

Discuss this help topic in SecureBlackbox Forum