21 #ifndef G_SMTP_NEW_FILE_H
22 #define G_SMTP_NEW_FILE_H
46 G_EXCEPTION( InvalidPath ,
"invalid path -- must be absolute" ) ;
48 NewFile(
const std::string & from ,
FileStore & store ,
unsigned long max_size = 0UL ) ;
55 virtual void addTo(
const std::string & to ,
bool local ) ;
58 virtual bool addText(
const std::string & line ) ;
61 virtual std::string
prepare(
const std::string & auth_id ,
const std::string & peer_socket_address ,
62 const std::string & peer_socket_name ,
const std::string & peer_certificate ) ;
77 virtual unsigned long id()
const ;
89 std::auto_ptr<std::ostream> m_content ;
96 unsigned long m_size ;
97 unsigned long m_max_size ;
101 void flushContent() ;
102 void discardContent() ;
103 bool commitEnvelope() ;
104 void deleteContent() ;
105 void deleteEnvelope() ;
106 static bool isEightBit(
const std::string & line ) ;
107 const std::string & crlf()
const ;
108 bool saveEnvelope(
const std::string & auth_id ,
const std::string & peer_socket_address ,
109 const std::string & peer_socket_name ,
const std::string & peer_certificate )
const ;
110 void writeEnvelope( std::ostream & ,
const std::string & where ,
111 const std::string & auth_id ,
const std::string & peer_socket_address ,
112 const std::string & peer_socket_name ,
const std::string & peer_certificate )
const ;
G::Path contentPath() const
Returns the path of the content file.
SMTP and message-store classes.
std::list< std::string > Strings
A std::list of std::strings.
virtual void addTo(const std::string &to, bool local)
Final override from GSmtp::NewMessage.
virtual ~NewFile()
Destructor.
NewFile(const std::string &from, FileStore &store, unsigned long max_size=0UL)
Constructor. The FileStore reference is kept.
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.
A concrete derived class implementing the NewMessage interface.
virtual void commit()
Final override from GSmtp::NewMessage.
virtual unsigned long id() const
Final override from GSmtp::NewMessage.
#define G_EXCEPTION(class_name, description)
define as a function rather than a type if optimising for size
A concrete implementation of the MessageStore interface dealing in paired flat files and with an opti...
An abstract class to allow the creation of a new message in the message store.
virtual bool addText(const std::string &line)
Final override from GSmtp::NewMessage.
A Path object represents a file system path.