Public Member Functions | List of all members
GSmtp::NewFile Class Reference

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

#include <gnewfile.h>

Inheritance diagram for GSmtp::NewFile:
GSmtp::NewMessage

Public Member Functions

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

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 39 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 60 of file gnewfile.cpp.

References G_DEBUG.

Member Function Documentation

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

Final override from GSmtp::NewMessage.

Implements GSmtp::NewMessage.

Definition at line 123 of file gnewfile.cpp.

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

Final override from GSmtp::NewMessage.

Implements GSmtp::NewMessage.

Definition at line 115 of file gnewfile.cpp.

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 107 of file gnewfile.cpp.

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

Returns the path of the content file.

Definition at line 251 of file gnewfile.cpp.

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

Final override from GSmtp::NewMessage.

Implements GSmtp::NewMessage.

Definition at line 246 of file gnewfile.cpp.

std::string GSmtp::NewFile::prepare ( const std::string &  auth_id,
const std::string &  peer_socket_address,
const std::string &  peer_socket_name,
const std::string &  peer_certificate 
)
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 83 of file gnewfile.cpp.


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