Main Page | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

FetchResponse Class Reference

Inheritance diagram for FetchResponse:

Response List of all members.

Detailed Description

FetchResponse is a class that represents an IMAP4 FETCH response. One or more FETCH responses are usually sent by the server in response to a FETCH or STORE command. The FETCH response contains data items that contain message attributes or parts of the messages themselves. For example, a FETCH response can contain the flags associated with a message, or it can contain the header fields of a message, or it can contain the entire message. The data items that are present in a FETCH response depend on the items that were requested in the FETCH command.

This class presents a "fat" interface, in that there are accessors for each possible data item. If a data item is not present, the accessor returns a NULL or some other invalid value. One limitation of the interface is that you cannot request more than one body section data item -- that is, a "BODY[...]" data item -- in a single FETCH command.

In the typical usage, you would send a FETCH request for one or more data items using the function Imap4Client::Fetch. Then, you would iterate over the received responses, using Imap4Client::NumResponses and Imap4Client::Response, to find the FETCH responses. For each FETCH response, you should then examine the message sequence number by calling FetchResponse::SequenceNumber and extract the data items you requested by calling other member functions of FetchResponse.

See also:
Imap4Client::Fetch

Imap4Client::Store

Imap4Client::UidFetch

Imap4Client::UidStore


Public Member Functions

 FetchResponse ()
 Default constructor.
 FetchResponse (uint32_t sequenceNumber)
 Constructor that takes a sequence number parameter.
 FetchResponse (const FetchResponse &other)
 Copy constructor.
virtual ~FetchResponse ()
 Destructor.
FetchResponseoperator= (const FetchResponse &other)
 Assignment operator.
uint32_t SequenceNumber () const
 Returns message sequence number.
const Imap4DateInternalDate () const
 Returns INTERNALDATE data, if present.
const char * Rfc822 () const
 Returns RFC822 data, if present.
const char * Rfc822Header () const
 Returns RFC822.HEADER data, if present.
const char * Rfc822Text () const
 Returns RFC822.TEXT data, if present.
uint32_t Rfc822Size () const
 Returns RFC822.SIZE data, if present.
uint32_t Uid () const
 Returns UID data, if present.
const FlagsDataFlags () const
 Returns the FLAGS data, if present.
const EnvelopeDataEnvelope () const
 Returns ENVELOPE data, if present.
const BodyStructureDataBodyStructure () const
 Returns BODYSTRUCTURE or BODY data, if present.
const BodySectionDataBodySection () const
 Returns the body section data, if present.
void ImportData (ListItem *root)
 Called by the parser to set the data for this object.


Constructor & Destructor Documentation

FetchResponse  ) 
 

Default constructor

FetchResponse uint32_t  sequenceNumber  ) 
 

Constructor that takes a sequence number parameter

Parameters:
sequenceNumber message sequence number for this response

FetchResponse const FetchResponse other  ) 
 

Copy constructor

Parameters:
other other object to copy

~FetchResponse  )  [virtual]
 

Destructor


Member Function Documentation

const BodySectionData * BodySection  )  const
 

Returns the body section data, if present. If there is no body section data item, the function returns NULL.

The body section data item contains actual characters extracted from the specified message. A body section could be, for example, the collection of header fields from a message, or a particular body part that contains a file attachment.

Returns:
body section data, ir present; otherwise, NULL
See also:
BodySectionData

const BodyStructureData * BodyStructure  )  const
 

Returns the BODYSTRUCTURE or BODY data, if present. The BODYSTRUCTURE and BODY data items contain information about the structure of a message, such as the media type and how many body parts it contains. If there is no BODYSTRUCTURE or BODY data item, the function returns NULL. Note that BODY is a subset of BODYSTRUCTURE. BODYSTRUCTURE can contain extension data not present in BODY.

Returns:
BODYSTRUCTURE or BODY data, if present; otherwise, NULL
See also:
BodyStructureData

const EnvelopeData * Envelope  )  const
 

Returns the ENVELOPE data, if present. The ENVELOPE data item contains essential information extracted from the header fields of the message, such as the sender, the recipient(s), the date, and the subject. If there is no ENVELOPE data item, the function returns NULL.

Returns:
ENVELOPE data, if present; otherwise, NULL
See also:
EnvelopeData

const FlagsData * Flags  )  const
 

Returns the FLAGS data, if present. The FLAGS data item contains information about the flag attributes that are set for the message, such as whether the message has been read, whether it has been answered, and so on. If there is no FLAGS data item, the function returns NULL.

Returns:
FLAGS data item, if present; otherwise, NULL
See also:
FlagsData

void ImportData ListItem *  root  ) 
 

Called by the parser to set the data for this object.

Only the parser should call this function.

Parameters:
root root item of parse tree

const Imap4Date & InternalDate  )  const
 

Returns the INTERNALDATE data, if present. The INTERNALDATE from the FETCH response is parsed and converted to a scalar date/time. This scalar date indicates the number of seconds that have elapsed since 1 Jan 1970 00:00:00 UTC, which is the date format returned by the time() library function of nearly all UNIX systems.

If the response contains no INTERNALDATE data item, the function returns 0.

Returns:
INTERNALDATE attribute of message as a Unix time, if present; otherwise, zero

FetchResponse & operator= const FetchResponse other  ) 
 

Assignment operator.

Parameters:
other other object to copy
Returns:
*this

const char * Rfc822  )  const
 

Returns the RFC822 data, if present. The RFC822 data item includes the entire message. If the response contains no RFC822 data item, the function returns NULL.

Returns:
complete message, if present; otherwise, NULL

const char * Rfc822Header  )  const
 

Returns the RFC822.HEADER data, if present. The RFC822.HEADER data item contains the entire collection of header fields for the message. If the response contains no RFC822.HEADER data item, the function returns NULL.

Returns:
message header, if present; otherwise, NULL

unsigned Rfc822Size  )  const
 

Returns the RFC822.SIZE data, if present. The RFC822.SIZE data item contains the size of the message in bytes. If the response contains no RFC822.SIZE data item, the function returns 0.

Returns:
message size, if present; otherwise 0

const char * Rfc822Text  )  const
 

Returns the RFC822.TEXT data, if present. The RFC822.TEXT data item contains the entire body of the message. If the response contains no RFC822.TEXT data item, the function returns NULL.

Returns:
message body, if present; otherwise, NULL

uint32_t SequenceNumber  )  const
 

Returns the sequence number of the message to which the response applies. The sequence number is always present.

Returns:
message sequence number

unsigned Uid  )  const
 

Returns the UID data, if present. The UID is a 32-bit unsigned integer that serves as a unique identifier for the message. If the response contains no UID data item, the function returns 0.

Returns:
unique ID (UID), if present; otherwise, 0

Copyright © 2001-2005 Hunny Software, Inc. All rights reserved.