VMime
|
Additional Inherited Members | |
Static Public Attributes inherited from contentHandler | |
static const vmime::encoding | NO_ENCODING |
Protected Member Functions inherited from object | |
object () | |
object (const object &) | |
object & | operator= (const object &) |
virtual | ~object () |
A content handler which obtains its data from a stream.
Creates a new empty content handler.
No data can be extracted until an input stream is set using setData() function.
streamContentHandler | ( | shared_ptr< utility::inputStream > | is, |
const size_t | length, | ||
const vmime::encoding & | enc = NO_ENCODING |
||
) |
Creates a new content handler using an input stream.
is | input stream from which data will be obtained |
length | expected stream length. May be zero, but it is highly recommended to set this parameter to take part of some optimizations and features (eg. SMTP CHUNKING/SIZE extension). |
enc | set to anything other than NO_ENCODING if the data obtained from the stream is already encoded with the specified encoding |
References streamContentHandler::setData().
~streamContentHandler | ( | ) |
streamContentHandler | ( | const streamContentHandler & | cts | ) |
|
virtual |
|
virtual |
Extract the contents into the specified stream.
If needed, data will be decoded before being written into the stream.
exceptions::no_encoder_available | if the encoding is not supported |
os | output stream |
progress | progress listener, or NULL if you do not want to receive progress notifications |
Implements contentHandler.
References vmime::utility::bufferedStreamCopy(), encoding::getEncoder(), streamContentHandler::getLength(), and streamContentHandler::isEncoded().
|
virtual |
Extract the contents into the specified stream, without decoding it.
It may be useful in case the encoding is not supported and you want to extract raw data.
os | output stream |
progress | progress listener, or NULL if you do not want to receive progress notifications |
Implements contentHandler.
References vmime::utility::bufferedStreamCopy(), and streamContentHandler::getLength().
|
virtual |
Output the contents into the specified stream.
Data will be encoded before being written into the stream. This is used internally by the body object to generate the message, you may not need to use this (see contentHandler::extract() if you want to get the contents).
os | output stream |
enc | encoding for output |
maxLineLength | maximum line length for output |
Implements contentHandler.
References vmime::utility::bufferedStreamCopy(), encoding::getEncoder(), mediaType::getType(), streamContentHandler::isEncoded(), and vmime::mediaTypes::TEXT.
|
virtual |
Returns a hint about the kind of data managed by this object.
Implements contentHandler.
|
virtual |
Returns the encoding used for data (or "binary" if not encoded).
Implements contentHandler.
|
virtual |
Returns the actual length of data.
WARNING: this can return 0 if no length was specified when setting data of this object, or if the length is not known).
Implements contentHandler.
Referenced by streamContentHandler::extract(), and streamContentHandler::extractRaw().
|
virtual |
Indicates whether the extract() method can be called multiple times.
Implements contentHandler.
|
virtual |
Returns 'true' if there is no data set.
Implements contentHandler.
|
virtual |
Returns 'true' if data managed by this object is encoded.
Implements contentHandler.
References contentHandler::NO_ENCODING.
Referenced by streamContentHandler::extract(), and streamContentHandler::generate().
streamContentHandler & operator= | ( | const streamContentHandler & | cts | ) |
|
virtual |
Gives a hint about the kind of data managed by this object.
type | content media type |
Implements contentHandler.
void setData | ( | shared_ptr< utility::inputStream > | is, |
const size_t | length, | ||
const vmime::encoding & | enc = NO_ENCODING |
||
) |
Sets the data managed by this content handler.
is | input stream from which data will be obtained |
length | expected stream length. May be zero, but it is highly recommended to set this parameter to take part of some optimizations and features (eg. SMTP CHUNKING/SIZE extension). |
enc | set to anything other than NO_ENCODING if the data obtained from the stream is already encoded with the specified encoding |
Referenced by fileContentHandler::setData(), and streamContentHandler::streamContentHandler().