VMime
POP3Message Class Reference

#include <POP3Message.hpp>

Inheritance diagram for POP3Message:
Collaboration diagram for POP3Message:

Public Member Functions

 POP3Message (shared_ptr< POP3Folder > folder, const size_t num)
 ~POP3Message ()
size_t getNumber () const
const uid getUID () const
size_t getSize () const
bool isExpunged () const
shared_ptr< const messageStructuregetStructure () const
shared_ptr< messageStructuregetStructure ()
shared_ptr< const headergetHeader () const
int getFlags () const
void setFlags (const int flags, const int mode=FLAG_MODE_SET)
void extract (utility::outputStream &os, utility::progressListener *progress=NULL, const size_t start=0, const size_t length=-1, const bool peek=false) const
void extractPart (shared_ptr< const messagePart > p, utility::outputStream &os, utility::progressListener *progress=NULL, const size_t start=0, const size_t length=-1, const bool peek=false) const
void fetchPartHeader (shared_ptr< messagePart > p)
shared_ptr< vmime::messagegetParsedMessage ()
Public Member Functions inherited from message
virtual ~message ()

Additional Inherited Members

Public Types inherited from message
enum  Flags {
  FLAG_SEEN = (1 << 0) , FLAG_RECENT = (1 << 1) , FLAG_DELETED = (1 << 2) , FLAG_REPLIED = (1 << 3) ,
  FLAG_MARKED = (1 << 4) , FLAG_PASSED = (1 << 5) , FLAG_DRAFT = (1 << 6)
}
enum  FlagsModes { FLAG_MODE_SET , FLAG_MODE_ADD , FLAG_MODE_REMOVE }
Protected Types inherited from message
enum  PrivateConstants { FLAG_UNDEFINED = 9999 }
Protected Member Functions inherited from message
 message ()
 message (const message &)
Protected Member Functions inherited from object
 object ()
 object (const object &)
objectoperator= (const object &)
virtual ~object ()

Detailed Description

POP3 message implementation.

Constructor & Destructor Documentation

◆ POP3Message()

POP3Message ( shared_ptr< POP3Folder > folder,
const size_t num )

◆ ~POP3Message()

~POP3Message ( )

Member Function Documentation

◆ extract()

void extract ( utility::outputStream & os,
utility::progressListener * progress = NULL,
const size_t start = 0,
const size_t length = -1,
const bool peek = false ) const
virtual

Extract the whole message data (header + contents).

Warning
Partial fetch might not be supported by the underlying protocol.
Parameters
osoutput stream in which to write message data
progressprogress listener, or NULL if not used
startindex of the first byte to retrieve (used for partial fetch)
lengthnumber of bytes to retrieve (used for partial fetch)
peekif true, try not to mark the message as read. This may not be supported by the protocol (IMAP supports this), but it will NOT throw an exception if not supported.

Implements message.

References vmime::constCast(), folder::getStore(), POP3Response::readLargeResponse(), command_error::response(), and POP3Command::RETR().

Referenced by getParsedMessage(), and POP3Folder.

◆ extractPart()

void extractPart ( shared_ptr< const messagePart > p,
utility::outputStream & os,
utility::progressListener * progress = NULL,
const size_t start = 0,
const size_t length = -1,
const bool peek = false ) const
virtual

Extract the specified MIME part of the message (header + contents).

Warning
Partial fetch might not be supported by the underlying protocol.
Parameters
ppart to extract
osoutput stream in which to write part data
progressprogress listener, or NULL if not used
startindex of the first byte to retrieve (used for partial fetch)
lengthnumber of bytes to retrieve (used for partial fetch)
peekif true, try not to mark the message as read. This may not be supported by the protocol (IMAP supports this), but it will NOT throw an exception if not supported.

Implements message.

Referenced by POP3Folder.

◆ fetchPartHeader()

void fetchPartHeader ( shared_ptr< messagePart > p)
virtual

Fetch the MIME header for the specified part.

Parameters
pthe part for which to fetch the header

Implements message.

Referenced by POP3Folder.

◆ getFlags()

int getFlags ( ) const
virtual

Return the flags of this message.

Returns
flags of the message

Implements message.

References message::FLAG_DELETED.

Referenced by POP3Folder.

◆ getHeader()

shared_ptr< const header > getHeader ( ) const
virtual

Return a reference to the header fields of the message (must fetch before).

Returns
header section of the message

Implements message.

Referenced by POP3Folder.

◆ getNumber()

size_t getNumber ( ) const
virtual

Return the sequence number of this message.

This number is used to reference the message in the folder.

Returns
sequence number of the message

Implements message.

Referenced by POP3Folder::deleteMessages(), and POP3Folder.

◆ getParsedMessage()

shared_ptr< vmime::message > getParsedMessage ( )
virtual

Get the RFC-822 message for this abstract message.

Warning: This may require getting some data (ie: structure and headers) from the server, which is done automatically. Actual message contents (ie: body) will not be fetched if possible (IMAP allows it, whereas POP3 will require to fetch the whole message).

Returns
a RFC-822-parsed message

Implements message.

References extract().

Referenced by POP3Folder.

◆ getSize()

size_t getSize ( ) const
virtual

Return the size of the message (must fetch before).

Returns
size of the message (in bytes)

Implements message.

Referenced by POP3Folder.

◆ getStructure() [1/2]

shared_ptr< messageStructure > getStructure ( )
virtual

Return the MIME structure of the message (must fetch before).

Returns
MIME structure of the message

Implements message.

◆ getStructure() [2/2]

shared_ptr< const messageStructure > getStructure ( ) const
virtual

Return the MIME structure of the message (must fetch before).

Returns
MIME structure of the message

Implements message.

Referenced by POP3Folder.

◆ getUID()

const message::uid getUID ( ) const
virtual

Return the unique identifier (UID) of this message in its folder (must fetch before).

Returns
UID of the message

Implements message.

Referenced by POP3Folder.

◆ isExpunged()

bool isExpunged ( ) const
virtual

Check whether this message has been expunged (ie: definitively deleted) and does not exist in the folder anymore.

Returns
true if the message is expunged, false otherwise

Implements message.

Referenced by POP3Folder.

◆ setFlags()

void setFlags ( const int flags,
const int mode = FLAG_MODE_SET )
virtual

Set the flags of this message.

Parameters
flagsset of flags (see Flags)
modeindicate how to treat old and new flags (see FlagsModes)

Implements message.

Referenced by POP3Folder.


The documentation for this class was generated from the following files: