class Poco::Net::FilePartSource
Overview
An implementation of PartSource for plain files. Moreā¦
#include <FilePartSource.h> class FilePartSource: public Poco::Net::PartSource { public: // construction FilePartSource(const std::string& path); FilePartSource( const std::string& path, const std::string& mediaType ); FilePartSource( const std::string& path, const std::string& filename, const std::string& mediaType ); // methods virtual std::istream& stream(); virtual const std::string& filename() const; virtual std::streamsize getContentLength() const; };
Inherited Members
public: // fields static const int UNKNOWN_CONTENT_LENGTH; // methods virtual std::istream& stream() = 0; virtual const std::string& filename() const; const std::string& mediaType() const; MessageHeader& headers(); const MessageHeader& headers() const; virtual std::streamsize getContentLength() const;
Detailed Documentation
An implementation of PartSource for plain files.
Construction
FilePartSource(const std::string& path)
Creates the FilePartSource for the given path.
The MIME type is set to application/octet-stream.
Throws an OpenFileException if the file cannot be opened.
FilePartSource( const std::string& path, const std::string& mediaType )
Creates the FilePartSource for the given path and MIME type.
Throws an OpenFileException if the file cannot be opened.
FilePartSource( const std::string& path, const std::string& filename, const std::string& mediaType )
Creates the FilePartSource for the given path and MIME type.
The given filename is used as part filename (see filename()) only.
Throws an OpenFileException if the file cannot be opened.
Methods
virtual std::istream& stream()
Returns a file input stream for the given file.
virtual const std::string& filename() const
Returns the filename portion of the path.
virtual std::streamsize getContentLength() const
Returns the file size.