aboutsummaryrefslogtreecommitdiffstats
path: root/src/fileAttachment.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2013-11-21 21:16:57 +0000
committerVincent Richard <[email protected]>2013-11-21 21:16:57 +0000
commitf9913fa28a27f23fde2d4956c62cbb2fb2bc2ee8 (patch)
tree2bdc90e361a8f6e0a81164cf67afec9f78f9b959 /src/fileAttachment.cpp
parentPer-protocol include files. (diff)
downloadvmime-f9913fa28a27f23fde2d4956c62cbb2fb2bc2ee8.tar.gz
vmime-f9913fa28a27f23fde2d4956c62cbb2fb2bc2ee8.zip
Boost/C++11 shared pointers.
Diffstat (limited to 'src/fileAttachment.cpp')
-rw-r--r--src/fileAttachment.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/fileAttachment.cpp b/src/fileAttachment.cpp
index 4f4a87d3..1db1a1a8 100644
--- a/src/fileAttachment.cpp
+++ b/src/fileAttachment.cpp
@@ -79,7 +79,7 @@ fileAttachment::fileAttachment(const string& filepath, const mediaType& type,
}
-fileAttachment::fileAttachment(ref <contentHandler> cts, const word& filename, const mediaType& type)
+fileAttachment::fileAttachment(shared_ptr <contentHandler> cts, const word& filename, const mediaType& type)
{
if (!filename.isEmpty())
m_fileInfo.setFilename(filename);
@@ -92,7 +92,7 @@ fileAttachment::fileAttachment(ref <contentHandler> cts, const word& filename, c
}
-fileAttachment::fileAttachment(ref <contentHandler> cts, const word& filename,
+fileAttachment::fileAttachment(shared_ptr <contentHandler> cts, const word& filename,
const mediaType& type, const text& desc)
{
if (!filename.isEmpty())
@@ -107,7 +107,7 @@ fileAttachment::fileAttachment(ref <contentHandler> cts, const word& filename,
}
-fileAttachment::fileAttachment(ref <contentHandler> cts, const word& filename,
+fileAttachment::fileAttachment(shared_ptr <contentHandler> cts, const word& filename,
const mediaType& type, const text& desc, const encoding& enc)
{
if (!filename.isEmpty())
@@ -123,15 +123,15 @@ fileAttachment::fileAttachment(ref <contentHandler> cts, const word& filename,
void fileAttachment::setData(const string& filepath)
{
- ref <utility::fileSystemFactory> fsf = platform::getHandler()->getFileSystemFactory();
+ shared_ptr <utility::fileSystemFactory> fsf = platform::getHandler()->getFileSystemFactory();
utility::file::path path = fsf->stringToPath(filepath);
- ref <utility::file> file = fsf->create(path);
+ shared_ptr <utility::file> file = fsf->create(path);
if (!file->isFile())
throw exceptions::open_file_error();
- m_data = vmime::create <streamContentHandler>
+ m_data = make_shared <streamContentHandler>
(file->getFileReader()->getInputStream(), file->getLength());
m_fileInfo.setFilename(path.getLastComponent());
@@ -139,7 +139,7 @@ void fileAttachment::setData(const string& filepath)
}
-void fileAttachment::setData(ref <contentHandler> cts)
+void fileAttachment::setData(shared_ptr <contentHandler> cts)
{
m_data = cts;
@@ -147,12 +147,12 @@ void fileAttachment::setData(ref <contentHandler> cts)
}
-void fileAttachment::generatePart(ref <bodyPart> part) const
+void fileAttachment::generatePart(shared_ptr <bodyPart> part) const
{
defaultAttachment::generatePart(part);
- ref <contentDispositionField> cdf = part->getHeader()->ContentDisposition().
- dynamicCast <contentDispositionField>();
+ shared_ptr <contentDispositionField> cdf =
+ dynamicCast <contentDispositionField>(part->getHeader()->ContentDisposition());
if (m_fileInfo.hasSize()) cdf->setSize(utility::stringUtils::toString(m_fileInfo.getSize()));
if (m_fileInfo.hasFilename() && !m_fileInfo.getFilename().isEmpty()) cdf->setFilename(m_fileInfo.getFilename());