cxxtools::MimeEntity Class Reference

A MimeEntity is a message with headers and a body. More...

#include <cxxtools/mime.h>

Inheritance diagram for cxxtools::MimeEntity:
cxxtools::MimeHeader

Public Types

enum  ContentTransferEncoding { none, quotedPrintable, base64 }

Public Member Functions

 MimeEntity ()
 Creates an mime entity without headers and an empty body.
 MimeEntity (const std::string &data)
 Creates an mime entity from a string.
 MimeEntity (std::istream &in)
 Reads an mime entity from a input stream.
const std::string & getBody () const
 Returns the body of the message.
std::string & getBody ()
 Returns the body of the message.
MimeEntitysetBody (const std::string &b)
 Sets the body of the message.
MimeEntityreadBody (std::istream &in)
MimeEntitysetContentTransferEncoding (ContentTransferEncoding cte)
ContentTransferEncoding getContentTransferEncoding () const
MimeEntitysetContentType (const std::string &ct)
std::string getContentType () const
MimeEntitysetHeader (const std::string &key, const std::string &value, bool replace=true)
 Set a header line to the mime entity.
- Public Member Functions inherited from cxxtools::MimeHeader
std::string getHeader (const std::string &key, const std::string &def=std::string()) const
 returns the header value or a default value
void addHeader (const std::string &key, const std::string &value)
 Adds a header line to the mime entity.
void unsetHeader (const std::string &key)
 Removes the header.
bool isMultipart () const
 Returns true, if the content type is multipart/*.

Friends

std::ostream & operator<< (std::ostream &out, const MimeEntity &mimeEntity)
void operator<<= (SerializationInfo &si, const MimeEntity &mo)
void operator>>= (const SerializationInfo &si, MimeEntity &mo)
MimeEntityoperator<< (MimeEntity &me, const std::string &str)
 operator to add a std::string to a mime entity body.
MimeEntityoperator<< (MimeEntity &me, const char *str)
 operator to add a const char* to a mime entity body.

Detailed Description

A MimeEntity is a message with headers and a body.

The headers contain typically a content type, which specifies, how the body is to be interpreted.

Member Enumeration Documentation

Enumerator:
none 
quotedPrintable 
base64 

Constructor & Destructor Documentation

cxxtools::MimeEntity::MimeEntity ( )
inline

Creates an mime entity without headers and an empty body.

cxxtools::MimeEntity::MimeEntity ( const std::string &  data)
explicit

Creates an mime entity from a string.

The string must be a mime message. On errors an exception is thrown.

cxxtools::MimeEntity::MimeEntity ( std::istream &  in)
explicit

Reads an mime entity from a input stream.

Member Function Documentation

const std::string& cxxtools::MimeEntity::getBody ( ) const
inline

Returns the body of the message.

std::string& cxxtools::MimeEntity::getBody ( )
inline

Returns the body of the message.

ContentTransferEncoding cxxtools::MimeEntity::getContentTransferEncoding ( ) const
std::string cxxtools::MimeEntity::getContentType ( ) const
inline
MimeEntity& cxxtools::MimeEntity::readBody ( std::istream &  in)
MimeEntity& cxxtools::MimeEntity::setBody ( const std::string &  b)
inline

Sets the body of the message.

MimeEntity& cxxtools::MimeEntity::setContentTransferEncoding ( ContentTransferEncoding  cte)
MimeEntity& cxxtools::MimeEntity::setContentType ( const std::string &  ct)
inline
MimeEntity& cxxtools::MimeEntity::setHeader ( const std::string &  key,
const std::string &  value,
bool  replace = true 
)
inline

Set a header line to the mime entity.

Reimplemented from cxxtools::MimeHeader.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const MimeEntity mimeEntity 
)
friend
MimeEntity& operator<< ( MimeEntity me,
const std::string &  str 
)
friend

operator to add a std::string to a mime entity body.

MimeEntity& operator<< ( MimeEntity me,
const char *  str 
)
friend

operator to add a const char* to a mime entity body.

void operator<<= ( SerializationInfo si,
const MimeEntity mo 
)
friend
void operator>>= ( const SerializationInfo si,
MimeEntity mo 
)
friend

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