21#ifndef G_SMTP_NEW_MESSAGE_H
22#define G_SMTP_NEW_MESSAGE_H
58 virtual void addTo(
const std::string & to ,
bool local , MessageStore::AddressStyle ) = 0 ;
61 virtual Status
addContent(
const char * , std::size_t ) = 0 ;
67 virtual void prepare(
const std::string & session_auth_id ,
68 const std::string & peer_socket_address ,
const std::string & peer_certificate ) = 0 ;
73 virtual void commit(
bool throw_on_error ) = 0 ;
A somewhat opaque identifer for a GStore::MessageStore message id.
An abstract class to allow the creation of a new message in the message store.
virtual void commit(bool throw_on_error)=0
Commits the prepare()d message to the store and disables the cleanup otherwise performed by the destr...
virtual std::string location() const =0
Returns the message's unique location.
virtual ~NewMessage()=default
Destructor.
virtual Status addContent(const char *, std::size_t)=0
Adds a line of content, typically ending with CR-LF.
virtual MessageId id() const =0
Returns the message's unique identifier.
virtual std::size_t contentSize() const =0
Returns the content size.
void addContentLine(const std::string &)
A convenience function that calls addContent() taking a string parameter and adding CR-LF.
virtual void prepare(const std::string &session_auth_id, const std::string &peer_socket_address, const std::string &peer_certificate)=0
Prepares to store the message in the message store.
virtual void addTo(const std::string &to, bool local, MessageStore::AddressStyle)=0
Adds a 'to' address.