VMime
SMTPResponse Class Reference

#include <SMTPResponse.hpp>

Inheritance diagram for SMTPResponse:
Collaboration diagram for SMTPResponse:

Classes

struct  state
struct  enhancedStatusCode
class  responseLine

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< SMTPResponse > readResponse (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

◆ getCode()

int getCode ( ) const

Return the SMTP response code.

Returns
response code

References getCode().

Referenced by getCode().

◆ getCurrentState()

const SMTPResponse::state getCurrentState ( ) const

Returns the current state of the response parser.

Returns
current parser state

References getCurrentState(), and SMTPResponse::state::responseBuffer.

Referenced by getCurrentState().

◆ getEnhancedCode()

const SMTPResponse::enhancedStatusCode getEnhancedCode ( ) const

Return the SMTP enhanced status code, if available.

Returns
enhanced status code

References getEnhancedCode().

Referenced by getEnhancedCode().

◆ getLastLine()

const SMTPResponse::responseLine getLastLine ( ) const

Return the last line in the response.

Returns
last response line

References getLastLine().

Referenced by getLastLine().

◆ getLineAt()

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

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 SMTP response text.

The text of each line is concatenated.

Returns
response text

References getText().

Referenced by getText().

◆ readResponse()

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

References readResponse().

Referenced by SMTPConnection::readResponse(), and readResponse().


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