#include <UploadedFileImpl.h>
Public Member Functions | |
UploadedFileImpl (const std::string &, bool, const std::string &, const std::string &) | |
~UploadedFileImpl () | |
virtual bool | isEmpty () const |
virtual const std::string & | getName () const |
virtual std::iostream & | getStream () throw (servlet::IOError) |
virtual const std::string & | mimeType () const |
Protected Member Functions | |
void | killTmp () |
virtual void | doMoveTo (const std::string &path) throw (servlet::IOError) |
Private Attributes | |
std::string | m_fpath |
Path to temporary file. | |
bool | m_empty |
Set to true if no file data was supplied. | |
std::fstream | m_stream |
std::string | m_mimeType |
MIME type of the file. | |
std::string | m_name |
Name of the file, as supplied by browser. |
Definition at line 35 of file UploadedFileImpl.h.
container::UploadedFileImpl::UploadedFileImpl | ( | const std::string & | path, | |
bool | empty, | |||
const std::string & | mime, | |||
const std::string & | name | |||
) |
Definition at line 26 of file UploadedFileImpl.cpp.
container::UploadedFileImpl::~UploadedFileImpl | ( | ) |
Definition at line 39 of file UploadedFileImpl.cpp.
References killTmp(), servlet::UploadedFile::m_moved, and m_stream.
void container::UploadedFileImpl::doMoveTo | ( | const std::string & | path | ) | throw (servlet::IOError) [protected, virtual] |
path | Where to put saved file This function takes data from internal stream and puts into file named by path |
Implements servlet::UploadedFile.
Definition at line 110 of file UploadedFileImpl.cpp.
const std::string & container::UploadedFileImpl::getName | ( | ) | const [virtual] |
Implements servlet::UploadedFile.
Definition at line 67 of file UploadedFileImpl.cpp.
References m_name.
std::iostream & container::UploadedFileImpl::getStream | ( | ) | throw (servlet::IOError) [virtual] |
returns stream refering to downloaded file. It may not nessesarily be file
Implements servlet::UploadedFile.
Definition at line 81 of file UploadedFileImpl.cpp.
bool container::UploadedFileImpl::isEmpty | ( | ) | const [virtual] |
Implements servlet::UploadedFile.
Definition at line 55 of file UploadedFileImpl.cpp.
References m_empty.
void container::UploadedFileImpl::killTmp | ( | ) | [protected] |
Unlinks temporary file
Definition at line 99 of file UploadedFileImpl.cpp.
References m_fpath.
Referenced by ~UploadedFileImpl().
const std::string & container::UploadedFileImpl::mimeType | ( | ) | const [virtual] |
Implements servlet::UploadedFile.
Definition at line 71 of file UploadedFileImpl.cpp.
References m_mimeType.
bool container::UploadedFileImpl::m_empty [private] |
Set to true if no file data was supplied.
Definition at line 41 of file UploadedFileImpl.h.
Referenced by isEmpty().
std::string container::UploadedFileImpl::m_fpath [private] |
Path to temporary file.
Definition at line 39 of file UploadedFileImpl.h.
Referenced by getStream(), and killTmp().
std::string container::UploadedFileImpl::m_mimeType [private] |
std::string container::UploadedFileImpl::m_name [private] |
Name of the file, as supplied by browser.
Definition at line 48 of file UploadedFileImpl.h.
Referenced by getName().
container::UploadedFileImpl::m_stream [private] |
Reference to stream
Definition at line 44 of file UploadedFileImpl.h.
Referenced by getStream(), and ~UploadedFileImpl().