VMime
POP3Response Class Reference

#include <POP3Response.hpp>

Inheritance diagram for POP3Response:
Collaboration diagram for POP3Response:

Public Types

enum  ResponseCode { CODE_OK = 0 , CODE_READY , CODE_ERR }

Public Member Functions

bool isSuccess () const
ResponseCode getCode () const
const string getText () const
const string getFirstLine () const
const string getLineAt (const size_t pos) const
size_t getLineCount () const

Static Public Member Functions

static shared_ptr< POP3Response > readResponse (shared_ptr< POP3Connection > conn)
static shared_ptr< POP3Response > readMultilineResponse (shared_ptr< POP3Connection > conn)
static shared_ptr< POP3Response > readLargeResponse (shared_ptr< POP3Connection > conn, utility::outputStream &os, utility::progressListener *progress, const size_t predictedSize)

Additional Inherited Members

Protected Member Functions inherited from object
 object ()
 object (const object &)
objectoperator= (const object &)
virtual ~object ()

Detailed Description

A POP3 response, as sent by the server.

Member Enumeration Documentation

◆ ResponseCode

Possible response codes.

Enumerator
CODE_OK 
CODE_READY 
CODE_ERR 

Member Function Documentation

◆ getCode()

POP3Response::ResponseCode getCode ( ) const

Return the POP3 response code.

Returns
response code

References getCode().

Referenced by getCode().

◆ getFirstLine()

const string getFirstLine ( ) const

Return the first POP3 response line.

Returns
first response line

References getFirstLine().

Referenced by getFirstLine().

◆ getLineAt()

const string getLineAt ( const size_t pos) const

Return the response line at the specified position.

Parameters
posline index
Returns
line at the specified index

References getLineAt().

Referenced by getLineAt().

◆ getLineCount()

size_t getLineCount ( ) const

Return the number of lines in the response.

Returns
number of lines in the response

References getLineCount().

Referenced by getLineCount().

◆ getText()

const string getText ( ) const

Return the POP3 response text (first line).

Returns
response text

References getText().

Referenced by getText().

◆ isSuccess()

bool isSuccess ( ) const

Returns whether the response is successful ("OK").

Returns
true if the response if successful, false otherwise

References CODE_OK, and isSuccess().

Referenced by isSuccess().

◆ readLargeResponse()

shared_ptr< POP3Response > readLargeResponse ( shared_ptr< POP3Connection > conn,
utility::outputStream & os,
utility::progressListener * progress,
const size_t predictedSize )
static

Receive and parse a large POP3 response (eg.

message data) from the specified connection.

Parameters
connconnection from which to read
osoutput stream to which response data will be written
progressprogress listener (can be NULL)
predictedSizeestimated size of response data (in bytes)
Returns
POP3 response
Exceptions
exceptions::operation_timed_outif no data has been received within the granted time

References readLargeResponse().

Referenced by POP3Message::extract(), and readLargeResponse().

◆ readMultilineResponse()

shared_ptr< POP3Response > readMultilineResponse ( shared_ptr< POP3Connection > conn)
static

Receive and parse a multiline POP3 response from the specified connection.

Parameters
connconnection from which to read
Returns
POP3 response
Exceptions
exceptions::operation_timed_outif no data has been received within the granted time

References readMultilineResponse(), and stringUtils::trim().

Referenced by POP3Folder::fetchMessages(), and readMultilineResponse().

◆ readResponse()

shared_ptr< POP3Response > readResponse ( shared_ptr< POP3Connection > conn)
static

Receive and parse a POP3 response from the specified connection.

Parameters
connconnection from which to read
Returns
POP3 response
Exceptions
exceptions::operation_timed_outif no data has been received within the granted time

References readResponse().

Referenced by POP3Folder::close(), POP3Connection::connect(), POP3Folder::deleteMessages(), POP3Folder::fetchMessage(), POP3Folder::getStatus(), POP3Store::noop(), POP3Folder::open(), and readResponse().


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