mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-28 03:20:11 +01:00
style fix
This commit is contained in:
@@ -50,13 +50,13 @@ class Net_API MailMessage: public MessageHeader
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef std::vector<MailRecipient> Recipients;
|
typedef std::vector<MailRecipient> Recipients;
|
||||||
|
|
||||||
enum ContentDisposition
|
enum ContentDisposition
|
||||||
{
|
{
|
||||||
CONTENT_INLINE,
|
CONTENT_INLINE,
|
||||||
CONTENT_ATTACHMENT
|
CONTENT_ATTACHMENT
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ContentTransferEncoding
|
enum ContentTransferEncoding
|
||||||
{
|
{
|
||||||
ENCODING_7BIT,
|
ENCODING_7BIT,
|
||||||
@@ -72,16 +72,16 @@ public:
|
|||||||
ContentDisposition disposition;
|
ContentDisposition disposition;
|
||||||
ContentTransferEncoding encoding;
|
ContentTransferEncoding encoding;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::vector<Part> PartVec;
|
typedef std::vector<Part> PartVec;
|
||||||
|
|
||||||
MailMessage(PartStoreFactory* pStoreFactory = 0);
|
MailMessage(PartStoreFactory* pStoreFactory = 0);
|
||||||
/// Creates an empty MailMessage.
|
/// Creates an empty MailMessage.
|
||||||
///
|
///
|
||||||
/// If pStoreFactory is not null, message attachments will be
|
/// If pStoreFactory is not null, message attachments will be
|
||||||
/// handled by the object created by the factory. Most
|
/// handled by the object created by the factory. Most
|
||||||
/// common reason is to temporarily save attachments to
|
/// common reason is to temporarily save attachments to
|
||||||
/// the file system in order to avoid potential memory
|
/// the file system in order to avoid potential memory
|
||||||
/// exhaustion when attachment files are very large.
|
/// exhaustion when attachment files are very large.
|
||||||
|
|
||||||
virtual ~MailMessage();
|
virtual ~MailMessage();
|
||||||
@@ -92,7 +92,7 @@ public:
|
|||||||
|
|
||||||
void setRecipients(const Recipients& recipient);
|
void setRecipients(const Recipients& recipient);
|
||||||
/// Clears existing and sets new recipient list for the message.
|
/// Clears existing and sets new recipient list for the message.
|
||||||
|
|
||||||
const Recipients& recipients() const;
|
const Recipients& recipients() const;
|
||||||
/// Returns the recipients of the message.
|
/// Returns the recipients of the message.
|
||||||
|
|
||||||
@@ -103,10 +103,10 @@ public:
|
|||||||
/// characters. To include non-ASCII characters
|
/// characters. To include non-ASCII characters
|
||||||
/// in the subject, use RFC 2047 word encoding
|
/// in the subject, use RFC 2047 word encoding
|
||||||
/// (see encodeWord()).
|
/// (see encodeWord()).
|
||||||
|
|
||||||
const std::string& getSubject() const;
|
const std::string& getSubject() const;
|
||||||
/// Returns the subject of the message.
|
/// Returns the subject of the message.
|
||||||
|
|
||||||
void setSender(const std::string& sender);
|
void setSender(const std::string& sender);
|
||||||
/// Sets the sender of the message (which
|
/// Sets the sender of the message (which
|
||||||
/// ends up in the From header field).
|
/// ends up in the From header field).
|
||||||
@@ -135,28 +135,28 @@ public:
|
|||||||
/// message.
|
/// message.
|
||||||
///
|
///
|
||||||
/// Note that single CR or LF characters as line delimiters must
|
/// Note that single CR or LF characters as line delimiters must
|
||||||
/// not be used. Content lines always should be terminated with a
|
/// not be used. Content lines always should be terminated with a
|
||||||
/// proper CRLF sequence.
|
/// proper CRLF sequence.
|
||||||
|
|
||||||
const std::string& getContent() const;
|
const std::string& getContent() const;
|
||||||
/// Returns the content of the mail message.
|
/// Returns the content of the mail message.
|
||||||
///
|
///
|
||||||
/// A content will only be returned for single-part
|
/// A content will only be returned for single-part
|
||||||
/// messages. The content of multi-part mail messages
|
/// messages. The content of multi-part mail messages
|
||||||
/// will be reported through the registered PartHandler.
|
/// will be reported through the registered PartHandler.
|
||||||
|
|
||||||
void setContentType(const std::string& mediaType);
|
void setContentType(const std::string& mediaType);
|
||||||
/// Sets the content type for the message.
|
/// Sets the content type for the message.
|
||||||
|
|
||||||
void setContentType(const MediaType& mediaType);
|
void setContentType(const MediaType& mediaType);
|
||||||
/// Sets the content type for the message.
|
/// Sets the content type for the message.
|
||||||
|
|
||||||
const std::string& getContentType() const;
|
const std::string& getContentType() const;
|
||||||
/// Returns the content type for the message.
|
/// Returns the content type for the message.
|
||||||
|
|
||||||
void setDate(const Poco::Timestamp& dateTime);
|
void setDate(const Poco::Timestamp& dateTime);
|
||||||
/// Sets the Date header to the given date/time value.
|
/// Sets the Date header to the given date/time value.
|
||||||
|
|
||||||
Poco::Timestamp getDate() const;
|
Poco::Timestamp getDate() const;
|
||||||
/// Returns the value of the Date header.
|
/// Returns the value of the Date header.
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@ public:
|
|||||||
void addPart(const std::string& name,
|
void addPart(const std::string& name,
|
||||||
PartSource* pSource,
|
PartSource* pSource,
|
||||||
ContentDisposition disposition,
|
ContentDisposition disposition,
|
||||||
ContentTransferEncoding encoding);
|
ContentTransferEncoding encoding);
|
||||||
/// Adds a part/attachment to the mail message.
|
/// Adds a part/attachment to the mail message.
|
||||||
///
|
///
|
||||||
/// The MailMessage takes ownership of the PartSource and deletes it
|
/// The MailMessage takes ownership of the PartSource and deletes it
|
||||||
@@ -177,7 +177,7 @@ public:
|
|||||||
///
|
///
|
||||||
/// The part name, and the filename specified in the part source
|
/// The part name, and the filename specified in the part source
|
||||||
/// must not contain any non-ASCII characters.
|
/// must not contain any non-ASCII characters.
|
||||||
/// To include non-ASCII characters in the part name or filename,
|
/// To include non-ASCII characters in the part name or filename,
|
||||||
/// use RFC 2047 word encoding (see encodeWord()).
|
/// use RFC 2047 word encoding (see encodeWord()).
|
||||||
|
|
||||||
void addContent(PartSource* pSource,
|
void addContent(PartSource* pSource,
|
||||||
@@ -187,7 +187,7 @@ public:
|
|||||||
///
|
///
|
||||||
/// The part name, and the filename specified in the part source
|
/// The part name, and the filename specified in the part source
|
||||||
/// must not contain any non-ASCII characters.
|
/// must not contain any non-ASCII characters.
|
||||||
/// To include non-ASCII characters in the part name or filename,
|
/// To include non-ASCII characters in the part name or filename,
|
||||||
/// use RFC 2047 word encoding (see encodeWord()).
|
/// use RFC 2047 word encoding (see encodeWord()).
|
||||||
|
|
||||||
void addAttachment(const std::string& name,
|
void addAttachment(const std::string& name,
|
||||||
@@ -198,17 +198,17 @@ public:
|
|||||||
///
|
///
|
||||||
/// The part name, and the filename specified in the part source
|
/// The part name, and the filename specified in the part source
|
||||||
/// must not contain any non-ASCII characters.
|
/// must not contain any non-ASCII characters.
|
||||||
/// To include non-ASCII characters in the part name or filename,
|
/// To include non-ASCII characters in the part name or filename,
|
||||||
/// use RFC 2047 word encoding (see encodeWord()).
|
/// use RFC 2047 word encoding (see encodeWord()).
|
||||||
|
|
||||||
PartSource* createPartStore(const std::string& content,
|
PartSource* createPartStore(const std::string& content,
|
||||||
const std::string& mediaType,
|
const std::string& mediaType,
|
||||||
const std::string& filename = "");
|
const std::string& filename = "");
|
||||||
/// Returns either default StringPartSource part store or,
|
/// Returns either default StringPartSource part store or,
|
||||||
/// if the part store factory was provided during construction,
|
/// if the part store factory was provided during construction,
|
||||||
/// the one created by PartStoreFactory.
|
/// the one created by PartStoreFactory.
|
||||||
/// Returned part store is allocated on the heap; it is caller's
|
/// Returned part store is allocated on the heap; it is caller's
|
||||||
/// responsibility to delete it after use. Typical use is handler
|
/// responsibility to delete it after use. Typical use is handler
|
||||||
/// passing it back to MailMessage, which takes care of the cleanup.
|
/// passing it back to MailMessage, which takes care of the cleanup.
|
||||||
|
|
||||||
const PartVec& parts() const;
|
const PartVec& parts() const;
|
||||||
@@ -232,13 +232,13 @@ public:
|
|||||||
/// Writes the mail message to the given output stream.
|
/// Writes the mail message to the given output stream.
|
||||||
|
|
||||||
static std::string encodeWord(const std::string& text, const std::string& charset = "UTF-8");
|
static std::string encodeWord(const std::string& text, const std::string& charset = "UTF-8");
|
||||||
/// If the given string contains non-ASCII characters,
|
/// If the given string contains non-ASCII characters,
|
||||||
/// encodes the given string using RFC 2047 "Q" word encoding.
|
/// encodes the given string using RFC 2047 "Q" word encoding.
|
||||||
///
|
///
|
||||||
/// The given text must already be encoded in the character set
|
/// The given text must already be encoded in the character set
|
||||||
/// given in charset (default is UTF-8).
|
/// given in charset (default is UTF-8).
|
||||||
///
|
///
|
||||||
/// Returns the encoded string, or the original string if it
|
/// Returns the encoded string, or the original string if it
|
||||||
/// consists only of ASCII characters.
|
/// consists only of ASCII characters.
|
||||||
|
|
||||||
static const std::string HEADER_SUBJECT;
|
static const std::string HEADER_SUBJECT;
|
||||||
@@ -260,7 +260,6 @@ public:
|
|||||||
static const std::string CTE_BASE64;
|
static const std::string CTE_BASE64;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
void makeMultipart();
|
void makeMultipart();
|
||||||
void writeHeader(const MessageHeader& header, std::ostream& ostr) const;
|
void writeHeader(const MessageHeader& header, std::ostream& ostr) const;
|
||||||
void writeMultipart(MessageHeader& header, std::ostream& ostr) const;
|
void writeMultipart(MessageHeader& header, std::ostream& ostr) const;
|
||||||
|
|||||||
@@ -33,20 +33,20 @@ class Net_API PartSource
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual std::istream& stream() = 0;
|
virtual std::istream& stream() = 0;
|
||||||
/// Returns an input stream for reading the
|
/// Returns an input stream for reading the
|
||||||
/// part data.
|
/// part data.
|
||||||
///
|
///
|
||||||
/// Subclasses must override this method.
|
/// Subclasses must override this method.
|
||||||
|
|
||||||
virtual const std::string& filename() const;
|
virtual const std::string& filename() const;
|
||||||
/// Returns the filename for the part or attachment.
|
/// Returns the filename for the part or attachment.
|
||||||
///
|
///
|
||||||
/// May be overridded by subclasses. The default
|
/// May be overridded by subclasses. The default
|
||||||
/// implementation returns an empty string.
|
/// implementation returns an empty string.
|
||||||
|
|
||||||
const std::string& mediaType() const;
|
const std::string& mediaType() const;
|
||||||
/// Returns the MIME media type for this part or attachment.
|
/// Returns the MIME media type for this part or attachment.
|
||||||
|
|
||||||
MessageHeader& headers();
|
MessageHeader& headers();
|
||||||
/// Returns a MessageHeader containing additional header
|
/// Returns a MessageHeader containing additional header
|
||||||
/// fields for the part.
|
/// fields for the part.
|
||||||
@@ -62,13 +62,14 @@ public:
|
|||||||
|
|
||||||
virtual ~PartSource();
|
virtual ~PartSource();
|
||||||
/// Destroys the PartSource.
|
/// Destroys the PartSource.
|
||||||
|
|
||||||
static const int UNKNOWN_CONTENT_LENGTH;
|
static const int UNKNOWN_CONTENT_LENGTH;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
PartSource();
|
PartSource();
|
||||||
/// Creates the PartSource, using
|
/// Creates the PartSource, using
|
||||||
/// the application/octet-stream MIME type.
|
/// the application/octet-stream MIME type.
|
||||||
|
|
||||||
PartSource(const std::string& mediaType);
|
PartSource(const std::string& mediaType);
|
||||||
/// Creates the PartSource, using the
|
/// Creates the PartSource, using the
|
||||||
/// given MIME type.
|
/// given MIME type.
|
||||||
|
|||||||
Reference in New Issue
Block a user