VMime
SMTPResponse Class Reference
Inheritance diagram for SMTPResponse:
Collaboration diagram for SMTPResponse:

Classes

struct  enhancedStatusCode
 
class  responseLine
 
struct  state
 

Public Member Functions

int getCode () const
 
const enhancedStatusCode getEnhancedCode () const
 
const string getText () const
 
const responseLine getLineAt (const size_t pos) const
 
size_t getLineCount () const
 
const responseLine getLastLine () const
 
const state getCurrentState () const
 

Static Public Member Functions

static shared_ptr< SMTPResponsereadResponse (shared_ptr< tracer > tr, shared_ptr< socket > sok, shared_ptr< timeoutHandler > toh, const state &st)
 

Additional Inherited Members

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

Detailed Description

A SMTP response, as sent by the server.

Member Function Documentation

int getCode ( ) const

Return the SMTP response code.

Returns
response code
const SMTPResponse::state getCurrentState ( ) const

Returns the current state of the response parser.

Returns
current parser state

References SMTPResponse::state::responseBuffer.

const SMTPResponse::enhancedStatusCode getEnhancedCode ( ) const

Return the SMTP enhanced status code, if available.

Returns
enhanced status code
const SMTPResponse::responseLine getLastLine ( ) const

Return the last line in the response.

Returns
last response line
const SMTPResponse::responseLine getLineAt ( const size_t  pos) const

Return the response line at the specified position.

Parameters
posline index
Returns
line at the specified index
size_t getLineCount ( ) const

Return the number of lines in the response.

Returns
number of lines in the response
const string getText ( ) const

Return the SMTP response text.

The text of each line is concatenated.

Returns
response text
shared_ptr< SMTPResponse > readResponse ( shared_ptr< tracer tr,
shared_ptr< socket sok,
shared_ptr< timeoutHandler toh,
const state st 
)
static

Receive and parse a new SMTP response from the specified socket.

Parameters
trtracer
soksocket from which to read
tohtime-out handler
stprevious state of response parser for the specified socket
Returns
SMTP response
Exceptions
exceptions::operation_timed_outif no data has been received within the granted time

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