VMime
|
Public Member Functions | |
mediaType () | |
mediaType (const string &type) | |
mediaType (const string &type, const string &subType) | |
bool | operator== (const mediaType &type) const |
bool | operator!= (const mediaType &type) const |
mediaType & | operator= (const string &type) |
shared_ptr< component > | clone () const |
void | copyFrom (const component &other) |
mediaType & | operator= (const mediaType &other) |
const std::vector< shared_ptr < component > > | getChildComponents () |
const string & | getType () const |
void | setType (const string &type) |
const string & | getSubType () const |
void | setSubType (const string &subType) |
void | setFromString (const string &type) |
Public Member Functions inherited from headerFieldValue | |
size_t | getGeneratedSize (const generationContext &ctx) |
Public Member Functions inherited from component | |
component () | |
virtual | ~component () |
void | parse (const string &buffer) |
void | parse (const parsingContext &ctx, const string &buffer) |
void | parse (shared_ptr< utility::inputStream > inputStream, const size_t length) |
void | parse (const string &buffer, const size_t position, const size_t end, size_t *newPosition=NULL) |
void | parse (const parsingContext &ctx, const string &buffer, const size_t position, const size_t end, size_t *newPosition=NULL) |
void | parse (shared_ptr< utility::inputStream > inputStream, const size_t position, const size_t end, size_t *newPosition=NULL) |
void | parse (const parsingContext &ctx, shared_ptr< utility::inputStream > inputStream, const size_t position, const size_t end, size_t *newPosition=NULL) |
virtual const string | generate (const size_t maxLineLength=lineLengthLimits::infinite, const size_t curLinePos=0) const |
virtual void | generate (utility::outputStream &outputStream, const size_t curLinePos=0, size_t *newLinePos=NULL) const |
virtual void | generate (const generationContext &ctx, utility::outputStream &outputStream, const size_t curLinePos=0, size_t *newLinePos=NULL) const |
size_t | getParsedOffset () const |
size_t | getParsedLength () const |
Protected Member Functions | |
void | parseImpl (const parsingContext &ctx, const string &buffer, const size_t position, const size_t end, size_t *newPosition=NULL) |
void | generateImpl (const generationContext &ctx, utility::outputStream &os, const size_t curLinePos=0, size_t *newLinePos=NULL) const |
Protected Member Functions inherited from component | |
void | setParsedBounds (const size_t start, const size_t end) |
virtual void | parseImpl (const parsingContext &ctx, shared_ptr< utility::parserInputStreamAdapter > parser, const size_t position, const size_t end, size_t *newPosition=NULL) |
Protected Member Functions inherited from object | |
object () | |
object (const object &) | |
object & | operator= (const object &) |
virtual | ~object () |
Protected Attributes | |
string | m_type |
string | m_subType |
Content media type (basic type).
mediaType | ( | ) |
References component::parse().
|
virtual |
Clone this component.
Implements component.
References mediaType::m_subType, and mediaType::m_type.
|
virtual |
Replace data in this component by data in other component.
Both components must be of the same type.
std::bad_cast_exception | if the components are not of the same (dynamic) type |
other | other component to copy data from |
Implements component.
References mediaType::m_subType, and mediaType::m_type.
Referenced by mediaType::operator=().
|
protectedvirtual |
Implements component.
References generationContext::getMaxLineLength(), vmime::NEW_LINE_SEQUENCE, and vmime::NEW_LINE_SEQUENCE_LENGTH.
|
virtual |
Return the list of children of this component.
Implements component.
const string & getSubType | ( | ) | const |
Return the media subtype.
See the constants in vmime::mediaTypes.
References mediaType::m_subType.
Referenced by attachmentHelper::getBodyPartAttachment().
const string & getType | ( | ) | const |
Return the media type.
See the constants in vmime::mediaTypes.
References mediaType::m_type.
Referenced by stringContentHandler::generate(), streamContentHandler::generate(), attachmentHelper::getBodyPartAttachment(), attachmentHelper::isBodyPartAnAttachment(), and body::parseImpl().
bool operator!= | ( | const mediaType & | type | ) | const |
References component::parse().
References mediaType::copyFrom().
bool operator== | ( | const mediaType & | type | ) | const |
References mediaType::m_subType, and mediaType::m_type.
|
protectedvirtual |
Reimplemented from component.
References vmime::end(), stringUtils::toLower(), and stringUtils::trim().
void setFromString | ( | const string & | type | ) |
Set the media type and subtype from a string in the form "type/subtype" (eg: "image/jpeg").
type | media type and subtype |
References component::parse().
void setSubType | ( | const string & | subType | ) |
Set the media subtype.
See the constants in vmime::mediaTypes.
subType | media subtype |
References mediaType::m_subType, and stringUtils::toLower().
void setType | ( | const string & | type | ) |
Set the media type.
See the constants in vmime::mediaTypes.
type | media type |
References mediaType::m_type, and stringUtils::toLower().
|
protected |
Referenced by mediaType::clone(), mediaType::copyFrom(), mediaType::getSubType(), mediaType::operator==(), and mediaType::setSubType().
|
protected |
Referenced by mediaType::clone(), mediaType::copyFrom(), mediaType::getType(), mediaType::operator==(), and mediaType::setType().