Poco::Net

class PartSource

Library: Net
Package: Messages
Header: Poco/Net/PartSource.h

Description

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.

Inheritance

Known Derived Classes: FilePartSource, StringPartSource

Member Summary

Member Functions: filename, mediaType, stream

Constructors

PartSource protected

PartSource();

Creates the PartSource, using the application/octet-stream MIME type.

PartSource protected

PartSource(
    const std::string & mediaType
);

Creates the PartSource, using the given MIME type.

Destructor

~PartSource virtual

virtual ~PartSource();

Destroys the PartSource.

Member Functions

filename virtual

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.

mediaType inline

const std::string & mediaType() const;

Returns the MIME media type for this part or attachment.

stream virtual

virtual std::istream & stream() = 0;

Returns an input stream for reading the part data.

Subclasses must override this method.