Discuss this help topic in SecureBlackbox Forum

TElMessagePartHandler.OnParse

TElMessagePartHandler     See also     


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


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

Declaration

[C#]
    not available

[VB.NET]
    not available

[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

[Java]
    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