From f9913fa28a27f23fde2d4956c62cbb2fb2bc2ee8 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Thu, 21 Nov 2013 22:16:57 +0100 Subject: Boost/C++11 shared pointers. --- src/platforms/windows/windowsFile.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/platforms/windows/windowsFile.cpp') diff --git a/src/platforms/windows/windowsFile.cpp b/src/platforms/windows/windowsFile.cpp index fd8a9651..8d2a19da 100644 --- a/src/platforms/windows/windowsFile.cpp +++ b/src/platforms/windows/windowsFile.cpp @@ -41,9 +41,9 @@ namespace platforms { namespace windows { -ref windowsFileSystemFactory::create(const vmime::utility::file::path& path) const +shared_ptr windowsFileSystemFactory::create(const vmime::utility::file::path& path) const { - return vmime::create (path); + return make_shared (path); } @@ -307,12 +307,12 @@ bool windowsFile::exists() const return false; } -ref windowsFile::getParent() const +shared_ptr windowsFile::getParent() const { if (m_path.isEmpty()) return NULL; else - return vmime::create (m_path.getParent()); + return make_shared (m_path.getParent()); } void windowsFile::rename(const path& newName) @@ -333,19 +333,19 @@ void windowsFile::remove() windowsFileSystemFactory::reportError(m_path, GetLastError()); } -ref windowsFile::getFileWriter() +shared_ptr windowsFile::getFileWriter() { - return vmime::create (m_path, m_nativePath); + return make_shared (m_path, m_nativePath); } -ref windowsFile::getFileReader() +shared_ptr windowsFile::getFileReader() { - return vmime::create (m_path, m_nativePath); + return make_shared (m_path, m_nativePath); } -ref windowsFile::getFiles() const +shared_ptr windowsFile::getFiles() const { - return vmime::create (m_path, m_nativePath); + return make_shared (m_path, m_nativePath); } void windowsFile::createDirectoryImpl(const vmime::utility::file::path& fullPath, const vmime::utility::file::path& path, const bool recursive) @@ -380,9 +380,9 @@ bool windowsFileIterator::hasMoreElements() const return m_moreElements; } -ref windowsFileIterator::nextElement() +shared_ptr windowsFileIterator::nextElement() { - ref pFile = vmime::create + shared_ptr pFile = make_shared (m_path / vmime::utility::file::path::component(m_findData.cFileName)); findNext(); @@ -430,7 +430,7 @@ windowsFileReader::windowsFileReader(const vmime::utility::file::path& path, con { } -ref windowsFileReader::getInputStream() +shared_ptr windowsFileReader::getInputStream() { HANDLE hFile = CreateFile( m_nativePath.c_str(), @@ -442,7 +442,7 @@ ref windowsFileReader::getInputStream() NULL); if (hFile == INVALID_HANDLE_VALUE) windowsFileSystemFactory::reportError(m_path, GetLastError()); - return vmime::create (m_path, hFile); + return make_shared (m_path, hFile); } windowsFileReaderInputStream::windowsFileReaderInputStream(const vmime::utility::file::path& path, HANDLE hFile) @@ -505,7 +505,7 @@ windowsFileWriter::windowsFileWriter(const vmime::utility::file::path& path, con { } -ref windowsFileWriter::getOutputStream() +shared_ptr windowsFileWriter::getOutputStream() { HANDLE hFile = CreateFile( m_nativePath.c_str(), @@ -517,7 +517,7 @@ ref windowsFileWriter::getOutputStream() NULL); if (hFile == INVALID_HANDLE_VALUE) windowsFileSystemFactory::reportError(m_path, GetLastError()); - return vmime::create (m_path, hFile); + return make_shared (m_path, hFile); } windowsFileWriterOutputStream::windowsFileWriterOutputStream(const vmime::utility::file::path& path, HANDLE hFile) -- cgit v1.2.3