Internet Direct (Indy)
Home
PreviousUpNext
TIdIOHandler.Capture Method (TIdStream, Integer, string, Boolean)

Reads data from the connection into the specified object.

Pascal
procedure Capture(
    ADest: TIdStream; 
    out VLineCount: Integer; 
    const ADelim: string = '.'; 
    AIsRFCMessage: Boolean = True
); overload;
Parameters 
Description 
ADest 
Storage for the captured data values.
 
VLineCount 
Number of lines resulting from the capture.
 
ADelim 
Delimiter for captured data values. Default value is '.'.
 
AIsRFCMessage 
Captured data is an RFC 2822 message. Default value is True. 

Capture is an overloaded procedure used to read data from the connection into the destination specified by ADest. If ADest contains an unknown or uninitialized data type, an EIdObjectTypeNotSupported exception with the message RSObjectTypeNotSupported will be raised. The overloaded methods provide support for both TIdStream and TIdStrings as the data type for ADest. 

VLineCount is used to return the number of lines resulting from the capture operation using the specified delimiter. 

ADelim is the delimiter used to determine if all data has been read from the connection. ADelim will appear as a line with no other data when all data has been captured. The default delimiter is '.', as used in most RFC-compliant protocols. 

AIsRFCMessage indicates that Capture is reading an RFC 2822 Internet message format where a line may contain the characters '..'. Capture will convert this character sequence to a single '.' character. A single '.' character in a line indicates the end of the RFC 822 message. 

Capture triggers the OnWorkBegin event handler with wmRead mode before reading data from the connection. Capture calls ReadLn to retrieve data from the connection until the delimiter specified in ADelim is received. Each line is written to ADest upon receipt. Capture triggers the OnWorkEnd event handler with wmRead mode when all data has been captured from the connection. 

Capture is used in the implementation of various protocol-oriented clients, like TIdIMAP4 and TIdNNTP.

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.