Main Page | Class Hierarchy | Class List | Class Members

BodySectionData Class Reference

List of all members.

Detailed Description

BodySectionData is a class that contains the characters of an IMAP4 body section data item. This data item carries the "bulk" data of a FETCH response, such as the RFC822 headers or body, or the content of a body part in a multipart MIME message.

Some typical examples of "sections" are the following:


Public Member Functions

 BodySectionData (const char *section, int offset)
 Constructor.
 BodySectionData (const BodySectionData &other)
 Copy constructor.
 ~BodySectionData ()
 Destructor.
BodySectionDataoperator= (const BodySectionData &other)
 Assignment operator.
const char * Section () const
 Gets the identifier for the section that the content is from.
uint32_t Offset () const
 Gets the offset of the content within the section.
uint32_t Length () const
 Gets the length of the content.
const char * Content () const
 Gets the characters of the content.
void ImportData (ListItem *root)
 Called by the parser to set the data for this object.


Constructor & Destructor Documentation

BodySectionData const char *  section,
int  offset
 

Constructor.

Parameters:
section identifier of the section
offset offset of the content

BodySectionData const BodySectionData other  ) 
 

Copy constructor.

Parameters:
other other object to copy

~BodySectionData  ) 
 

Destructor.


Member Function Documentation

const char * Content  )  const
 

Gets the characters of the content.

The content is always encoded as text characters. If the media type of the body section is not text, then the content is encoded using a content transfer encoding such as base64.

Use the Length member function to get the length of the content.

Returns:
characters of the content

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

uint32_t Length  )  const
 

Gets the length of the content.

IMAP4 allows a client to fetch the content of a particular section in multiple segments. Each segment has an offset and a length. This member function returns the length of the content. Use the Offset member function to get the offset of the content.

Returns:
length of the content

uint32_t Offset  )  const
 

Gets the offset of the content within the section.

IMAP4 allows a client to fetch the content of a particular section in multiple segments. Each segment has an offset and a length. This member function returns the offset of the content from the beginning of the segment. Use the Length member function to get the length of the content.

Returns:
offset of the content within the section

BodySectionData & operator= const BodySectionData other  ) 
 

Assignment operator.

Parameters:
other other object to copy
Returns:
*this

const char * Section  )  const
 

Gets the identifier for the section that the content is from.

The identifier indicates the section of the message that the content is from. For example, when the content contains the message headers, the identifier is "BODY[HEADER]".

Returns:
section that the content is from

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