cxxtools::MimeMultipart Class Reference

A MimeMultipart is a mime entity with multiple embedded entities. More...

#include <cxxtools/mime.h>

Inheritance diagram for cxxtools::MimeMultipart:
cxxtools::MimeHeader

Public Types

enum  Type {
  typeMixed, typeAlternative, typeDigest, typeParallel,
  typeRelated
}
typedef
MimeEntity::ContentTransferEncoding 
ContentTransferEncoding
typedef PartsType::const_iterator const_iterator
typedef PartsType::iterator iterator
typedef PartsType::size_type size_type

Public Member Functions

 MimeMultipart (const std::string &data)
 Parses a multipart entity.
 MimeMultipart (const MimeEntity &mimeEntity)
 Make a MimeMultipart entity from a MimeEntity.
 MimeMultipart (Type type_=typeMixed)
 Creates a empty MimeMultipart object.
size_type size () const
 Returns the number of entities in this object.
MimeEntityoperator[] (size_type n)
 Returns the nth entity.
const MimeEntityoperator[] (size_type n) const
 Returns the nth entity.
iterator begin ()
 Returns a iterator to the first entity.
iterator end ()
 Returns a iterator after the last entity.
const_iterator begin () const
 Returns a iterator to the first entity.
const_iterator end () const
 Returns a iterator after the last entity.
void setType (Type type_)
void setType (const std::string &type_)
MimeEntityaddObject ()
 Adds a empty mime entity and returns a reference to it.
MimeEntityaddObject (const MimeEntity &mimeEntity)
 Adds a entity to the mime entity.
MimeEntityaddObject (const std::string &data, const std::string &contentType="text/plain; charset=UTF-8", ContentTransferEncoding contentTransferEncoding=MimeEntity::quotedPrintable)
 Adds a entity to the mime entity. The data is passed as a std::string.
MimeEntityaddObject (std::istream &in, const std::string &contentType="text/plain; charset=UTF-8", ContentTransferEncoding contentTransferEncoding=MimeEntity::quotedPrintable)
 Adds a entity to the mime entity. The data is read from a input stream.
MimeEntityaddObject (const MimeMultipart &mimeMultipart)
MimeEntityattachTextFile (const std::string &data, const std::string &filename, const std::string &contentType="text/plain; charset=UTF-8")
 Adds a text file. The data is passed as a std::string.
MimeEntityattachTextFile (std::istream &in, const std::string &filename, const std::string &contentType="text/plain; charset=UTF-8")
 Adds a text file. The data is read from a istream.
MimeEntityattachBinaryFile (const std::string &data, const std::string &filename, const std::string &contentType="application/x-binary")
 Adds a binary file. The data is passed as a std::string.
MimeEntityattachBinaryFile (std::istream &in, const std::string &filename, const std::string &contentType="application/x-binary")
 Adds a binary file. The data is read from a istream.
- 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 setHeader (const std::string &key, const std::string &value, bool replace=true)
 Set a header line to the mime entity.
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 MimeMultipart &mime)
void operator<<= (SerializationInfo &si, const MimeMultipart &mm)
void operator>>= (const SerializationInfo &si, MimeMultipart &mm)
void operator>>= (const SerializationInfo &si, MimeEntity &mo)

Detailed Description

A MimeMultipart is a mime entity with multiple embedded entities.

Member Typedef Documentation

typedef PartsType::const_iterator cxxtools::MimeMultipart::const_iterator
typedef PartsType::iterator cxxtools::MimeMultipart::iterator
typedef PartsType::size_type cxxtools::MimeMultipart::size_type

Member Enumeration Documentation

Enumerator:
typeMixed 
typeAlternative 
typeDigest 
typeParallel 
typeRelated 

Constructor & Destructor Documentation

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

Parses a multipart entity.

cxxtools::MimeMultipart::MimeMultipart ( const MimeEntity mimeEntity)

Make a MimeMultipart entity from a MimeEntity.

If the content type is not multipart/something, a exception is thrown.

cxxtools::MimeMultipart::MimeMultipart ( Type  type_ = typeMixed)
inlineexplicit

Creates a empty MimeMultipart object.

Member Function Documentation

MimeEntity& cxxtools::MimeMultipart::addObject ( )
inline

Adds a empty mime entity and returns a reference to it.

MimeEntity& cxxtools::MimeMultipart::addObject ( const MimeEntity mimeEntity)
inline

Adds a entity to the mime entity.

MimeEntity& cxxtools::MimeMultipart::addObject ( const std::string &  data,
const std::string &  contentType = "text/plain; charset=UTF-8",
ContentTransferEncoding  contentTransferEncoding = MimeEntity::quotedPrintable 
)

Adds a entity to the mime entity. The data is passed as a std::string.

MimeEntity& cxxtools::MimeMultipart::addObject ( std::istream &  in,
const std::string &  contentType = "text/plain; charset=UTF-8",
ContentTransferEncoding  contentTransferEncoding = MimeEntity::quotedPrintable 
)

Adds a entity to the mime entity. The data is read from a input stream.

MimeEntity& cxxtools::MimeMultipart::addObject ( const MimeMultipart mimeMultipart)
MimeEntity& cxxtools::MimeMultipart::attachBinaryFile ( const std::string &  data,
const std::string &  filename,
const std::string &  contentType = "application/x-binary" 
)
inline

Adds a binary file. The data is passed as a std::string.

MimeEntity& cxxtools::MimeMultipart::attachBinaryFile ( std::istream &  in,
const std::string &  filename,
const std::string &  contentType = "application/x-binary" 
)
inline

Adds a binary file. The data is read from a istream.

MimeEntity& cxxtools::MimeMultipart::attachTextFile ( const std::string &  data,
const std::string &  filename,
const std::string &  contentType = "text/plain; charset=UTF-8" 
)
inline

Adds a text file. The data is passed as a std::string.

MimeEntity& cxxtools::MimeMultipart::attachTextFile ( std::istream &  in,
const std::string &  filename,
const std::string &  contentType = "text/plain; charset=UTF-8" 
)
inline

Adds a text file. The data is read from a istream.

iterator cxxtools::MimeMultipart::begin ( )
inline

Returns a iterator to the first entity.

const_iterator cxxtools::MimeMultipart::begin ( ) const
inline

Returns a iterator to the first entity.

iterator cxxtools::MimeMultipart::end ( )
inline

Returns a iterator after the last entity.

const_iterator cxxtools::MimeMultipart::end ( ) const
inline

Returns a iterator after the last entity.

MimeEntity& cxxtools::MimeMultipart::operator[] ( size_type  n)
inline

Returns the nth entity.

const MimeEntity& cxxtools::MimeMultipart::operator[] ( size_type  n) const
inline

Returns the nth entity.

void cxxtools::MimeMultipart::setType ( Type  type_)
void cxxtools::MimeMultipart::setType ( const std::string &  type_)
inline
size_type cxxtools::MimeMultipart::size ( ) const
inline

Returns the number of entities in this object.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const MimeMultipart mime 
)
friend
void operator<<= ( SerializationInfo si,
const MimeMultipart mm 
)
friend
void operator>>= ( const SerializationInfo si,
MimeMultipart mm 
)
friend
void operator>>= ( const SerializationInfo si,
MimeEntity mo 
)
friend

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