GSmtp::NewFile Class Reference

A concrete derived class implementing the NewMessage interface. More...

#include <gnewfile.h>

Inheritance diagram for GSmtp::NewFile:

GSmtp::NewMessage

List of all members.

Public Member Functions

 NewFile (const std::string &from, FileStore &store, unsigned long max_size=0UL)
 Constructor. The FileStore reference is kept.
virtual ~NewFile ()
 Destructor.
virtual void addTo (const std::string &to, bool local)
 Final override from GSmtp::NewMessage.
virtual bool addText (const std::string &line)
 Final override from GSmtp::NewMessage.
virtual std::string prepare (const std::string &auth_id, const std::string &client_ip)
 Final override from GSmtp::NewMessage.
virtual void commit ()
 Final override from GSmtp::NewMessage.
virtual unsigned long id () const
 Final override from GSmtp::NewMessage.
G::Path contentPath () const
 Returns the path of the content file.


Detailed Description

A concrete derived class implementing the NewMessage interface.

Writes itself to the i/o streams supplied by MessageStoreImp.

Definition at line 43 of file gnewfile.h.


Constructor & Destructor Documentation

GSmtp::NewFile::NewFile ( const std::string &  from,
FileStore store,
unsigned long  max_size = 0UL 
)

Constructor. The FileStore reference is kept.

Definition at line 38 of file gnewfile.cpp.

References GSmtp::FileStore::contentPath(), G_LOG, GSmtp::FileStore::newSeq(), and GSmtp::FileStore::stream().

GSmtp::NewFile::~NewFile (  )  [virtual]

Destructor.

If the new message has not been commit()ed then the files are deleted.

Definition at line 59 of file gnewfile.cpp.

References G_DEBUG, and GSmtp::FileStore::updated().


Member Function Documentation

void GSmtp::NewFile::addTo ( const std::string &  to,
bool  local 
) [virtual]

Final override from GSmtp::NewMessage.

Implements GSmtp::NewMessage.

Definition at line 113 of file gnewfile.cpp.

bool GSmtp::NewFile::addText ( const std::string &  line  )  [virtual]

Final override from GSmtp::NewMessage.

Implements GSmtp::NewMessage.

Definition at line 121 of file gnewfile.cpp.

std::string GSmtp::NewFile::prepare ( const std::string &  auth_id,
const std::string &  client_ip 
) [virtual]

Final override from GSmtp::NewMessage.

The implementation flushes and closes the content stream, creates a new envelope file (".new"), and does any local 'delivery' by creating ".local" copies. The path to the content file is returned.

Implements GSmtp::NewMessage.

Definition at line 82 of file gnewfile.cpp.

References GSmtp::FileStore::envelopePath(), GSmtp::FileStore::envelopeWorkingPath(), and G::Path::str().

void GSmtp::NewFile::commit (  )  [virtual]

Final override from GSmtp::NewMessage.

The implementation renames the ".new" envelope file, removing the extension.

Implements GSmtp::NewMessage.

Definition at line 105 of file gnewfile.cpp.

References G::Path::str().

unsigned long GSmtp::NewFile::id (  )  const [virtual]

Final override from GSmtp::NewMessage.

Implements GSmtp::NewMessage.

Definition at line 236 of file gnewfile.cpp.

G::Path GSmtp::NewFile::contentPath (  )  const

Returns the path of the content file.

Definition at line 241 of file gnewfile.cpp.


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

Generated on Fri Apr 18 15:56:13 2008 for E-MailRelay by  doxygen 1.5.5