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

A concete derived class implementing the StoredMessage interface. More...

#include <gstoredfile.h>

Inheritance diagram for GSmtp::StoredFile:
GSmtp::StoredMessage

Public Member Functions

 StoredFile (FileStore &store, const G::Path &envelope_path)
 Constructor. More...
 
virtual ~StoredFile ()
 Destructor. More...
 
bool lock ()
 Locks the file by renaming the envelope file. More...
 
bool readEnvelope (std::string &reason, bool check_for_no_remote_recipients)
 Reads the envelope. More...
 
bool openContent (std::string &reason)
 Opens the content file. More...
 
virtual std::string name () const
 Final override from GSmtp::StoredMessage. More...
 
virtual std::string location () const
 Final override from GSmtp::StoredMessage. More...
 
virtual bool eightBit () const
 Final override from GSmtp::StoredMessage. More...
 
virtual const std::string & from () const
 Final override from GSmtp::StoredMessage. More...
 
virtual const G::Stringsto () const
 Final override from GSmtp::StoredMessage. More...
 
virtual std::string authentication () const
 Final override from GSmtp::StoredMessage. More...
 
virtual void destroy ()
 Final override from GSmtp::StoredMessage. More...
 
virtual void fail (const std::string &reason, int reason_code)
 Final override from GSmtp::StoredMessage. More...
 
virtual void unfail ()
 Final override from GSmtp::StoredMessage. More...
 
virtual std::auto_ptr< std::istream > extractContentStream ()
 Final override from GSmtp::StoredMessage. More...
 
virtual size_t remoteRecipientCount () const
 Final override from GSmtp::StoredMessage. More...
 
virtual size_t errorCount () const
 Final override from GSmtp::StoredMessage. More...
 
virtual void sync ()
 Final override from GSmtp::StoredMessage. More...
 
- Public Member Functions inherited from GSmtp::StoredMessage
virtual ~StoredMessage ()
 Destructor. More...
 

Detailed Description

A concete derived class implementing the StoredMessage interface.

Definition at line 45 of file gstoredfile.h.

Constructor & Destructor Documentation

GSmtp::StoredFile::StoredFile ( FileStore store,
const G::Path envelope_path 
)

Constructor.

Definition at line 33 of file gstoredfile.cpp.

References G::Path::basename(), and G_DEBUG.

GSmtp::StoredFile::~StoredFile ( )
virtual

Destructor.

Unlocks the file if it has been lock()ed but not destroy()ed or fail()ed.

Definition at line 46 of file gstoredfile.cpp.

Member Function Documentation

std::string GSmtp::StoredFile::authentication ( ) const
virtual

Final override from GSmtp::StoredMessage.

Implements GSmtp::StoredMessage.

Definition at line 408 of file gstoredfile.cpp.

void GSmtp::StoredFile::destroy ( )
virtual

Final override from GSmtp::StoredMessage.

Implements GSmtp::StoredMessage.

Definition at line 354 of file gstoredfile.cpp.

References G::Path::basename(), G_LOG, and G::File::remove().

bool GSmtp::StoredFile::eightBit ( ) const
virtual

Final override from GSmtp::StoredMessage.

Implements GSmtp::StoredMessage.

Definition at line 67 of file gstoredfile.cpp.

size_t GSmtp::StoredFile::errorCount ( ) const
virtual

Final override from GSmtp::StoredMessage.

Implements GSmtp::StoredMessage.

Definition at line 403 of file gstoredfile.cpp.

std::auto_ptr< std::istream > GSmtp::StoredFile::extractContentStream ( )
virtual

Final override from GSmtp::StoredMessage.

Implements GSmtp::StoredMessage.

Definition at line 381 of file gstoredfile.cpp.

References G_ASSERT.

void GSmtp::StoredFile::fail ( const std::string &  reason,
int  reason_code 
)
virtual

Final override from GSmtp::StoredMessage.

Implements GSmtp::StoredMessage.

Definition at line 297 of file gstoredfile.cpp.

References G::Path::basename(), G::File::exists(), G_LOG_S, and G::File::rename().

const std::string & GSmtp::StoredFile::from ( ) const
virtual

Final override from GSmtp::StoredMessage.

Implements GSmtp::StoredMessage.

Definition at line 371 of file gstoredfile.cpp.

std::string GSmtp::StoredFile::location ( ) const
virtual

Final override from GSmtp::StoredMessage.

Implements GSmtp::StoredMessage.

Definition at line 62 of file gstoredfile.cpp.

bool GSmtp::StoredFile::lock ( )

Locks the file by renaming the envelope file.

Used by FileStore and FileIterator.

Definition at line 262 of file gstoredfile.cpp.

References G::Path::basename(), G_LOG, G::File::rename(), and G::Path::str().

std::string GSmtp::StoredFile::name ( ) const
virtual

Final override from GSmtp::StoredMessage.

Implements GSmtp::StoredMessage.

Definition at line 57 of file gstoredfile.cpp.

bool GSmtp::StoredFile::openContent ( std::string &  reason)

Opens the content file.

Returns false on error. Used by FileStore and FileIterator.

Definition at line 206 of file gstoredfile.cpp.

References G::Path::basename(), G_DEBUG, and G::Path::str().

bool GSmtp::StoredFile::readEnvelope ( std::string &  reason,
bool  check_for_no_remote_recipients 
)

Reads the envelope.

Returns false on error. Used by FileStore and FileIterator.

Definition at line 77 of file gstoredfile.cpp.

size_t GSmtp::StoredFile::remoteRecipientCount ( ) const
virtual

Final override from GSmtp::StoredMessage.

Implements GSmtp::StoredMessage.

Definition at line 398 of file gstoredfile.cpp.

void GSmtp::StoredFile::sync ( )
virtual

Final override from GSmtp::StoredMessage.

Implements GSmtp::StoredMessage.

Definition at line 72 of file gstoredfile.cpp.

const G::Strings & GSmtp::StoredFile::to ( ) const
virtual

Final override from GSmtp::StoredMessage.

Implements GSmtp::StoredMessage.

Definition at line 376 of file gstoredfile.cpp.

void GSmtp::StoredFile::unfail ( )
virtual

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