Library: Net
Package: Messages
Header: Poco/Net/PartSource.h
This abstract class is used for adding parts or attachments to mail messages, as well as for uploading files as part of a HTML form.
Known Derived Classes: FilePartSource, StringPartSource
Member Functions: filename, headers, mediaType, stream
PartSource();
Creates the PartSource, using the application/octet-stream MIME type.
PartSource(
const std::string & mediaType
);
Creates the PartSource, using the given MIME type.
virtual ~PartSource();
Destroys the PartSource.
virtual const std::string & filename();
Returns the filename for the part or attachment.
May be overridded by subclasses. The default implementation returns an empty string.
MessageHeader & headers();
Returns a MessageHeader containing additional header fields for the part.
const MessageHeader & headers() const;
Returns a MessageHeader containing additional header fields for the part.
const std::string & mediaType() const;
Returns the MIME media type for this part or attachment.
virtual std::istream & stream() = 0;
Returns an input stream for reading the part data.
Subclasses must override this method.