VMime
SMTPCommandSet Class Reference

#include <SMTPCommandSet.hpp>

Inheritance diagram for SMTPCommandSet:
Collaboration diagram for SMTPCommandSet:

Public Member Functions

void addCommand (shared_ptr< SMTPCommand > cmd)
bool isFinished () const
shared_ptr< SMTPCommandgetLastCommandSent () const
void writeToSocket (shared_ptr< socket > sok, shared_ptr< tracer > tr)
const string getText () const
const string getTraceText () const

Static Public Member Functions

static shared_ptr< SMTPCommandSet > create (const bool pipeline)
Static Public Member Functions inherited from SMTPCommand
static shared_ptr< SMTPCommandHELO (const string &hostname)
static shared_ptr< SMTPCommandEHLO (const string &hostname)
static shared_ptr< SMTPCommandAUTH (const string &mechName)
static shared_ptr< SMTPCommandAUTH (const string &mechName, const std::string &initialResponse)
static shared_ptr< SMTPCommandSTARTTLS ()
static shared_ptr< SMTPCommandMAIL (const mailbox &mbox, const bool utf8)
static shared_ptr< SMTPCommandMAIL (const mailbox &mbox, const bool utf8, const size_t size)
static shared_ptr< SMTPCommandRCPT (const mailbox &mbox, const bool utf8)
static shared_ptr< SMTPCommandRSET ()
static shared_ptr< SMTPCommandDATA ()
static shared_ptr< SMTPCommandBDAT (const size_t chunkSize, const bool last)
static shared_ptr< SMTPCommandNOOP ()
static shared_ptr< SMTPCommandQUIT ()
static shared_ptr< SMTPCommandcreateCommand (const string &text, const string &traceText="")

Additional Inherited Members

Protected Member Functions inherited from SMTPCommand
 SMTPCommand (const string &text, const string &traceText)
 SMTPCommand (const SMTPCommand &)
Protected Member Functions inherited from object
 object ()
 object (const object &)
objectoperator= (const object &)
virtual ~object ()

Detailed Description

A set of SMTP commands, which may be sent all at once to the server if pipelining is supported.

Member Function Documentation

◆ addCommand()

void addCommand ( shared_ptr< SMTPCommand > cmd)

Adds a new command to this set.

If one or more comments have already been sent to the server, an exception will be thrown.

Parameters
cmdcommand to add

References addCommand().

Referenced by addCommand().

◆ create()

shared_ptr< SMTPCommandSet > create ( const bool pipeline)
static

Creates a new set of SMTP commands.

Parameters
pipelineset to true if the server supports pipelining
Returns
a new SMTPCommandSet object

References create().

Referenced by create().

◆ getLastCommandSent()

shared_ptr< SMTPCommand > getLastCommandSent ( ) const

Returns the last command which has been sent.

Returns
a pointer to a SMTPCommand, of NULL if no command has been sent yet

References getLastCommandSent().

Referenced by getLastCommandSent().

◆ getText()

const string getText ( ) const
virtual

Returns the full text of the command, including command name and parameters (if any).

Returns
command text (eg. "RCPT TO:<vincent@kisli.com>")

Reimplemented from SMTPCommand.

References getText().

Referenced by getText().

◆ getTraceText()

const string getTraceText ( ) const
virtual

Returns the full text of the command, suitable for outputing to the tracer.

Returns
trace text (eg. "LOGIN myusername ***")

Reimplemented from SMTPCommand.

References getTraceText().

Referenced by getTraceText().

◆ isFinished()

bool isFinished ( ) const

Tests whether all commands have been sent.

Returns
true if all commands have been sent, or false otherwise

References isFinished().

Referenced by isFinished().

◆ writeToSocket()

void writeToSocket ( shared_ptr< socket > sok,
shared_ptr< tracer > tr )
virtual

Sends this command to the specified socket.

Parameters
soksocket to which the command will be written
trtracer

Reimplemented from SMTPCommand.

References writeToSocket().

Referenced by writeToSocket().


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