diff options
author | Vincent Richard <[email protected]> | 2013-11-21 21:16:57 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2013-11-21 21:16:57 +0000 |
commit | f9913fa28a27f23fde2d4956c62cbb2fb2bc2ee8 (patch) | |
tree | 2bdc90e361a8f6e0a81164cf67afec9f78f9b959 /src/platforms/windows | |
parent | Per-protocol include files. (diff) | |
download | vmime-f9913fa28a27f23fde2d4956c62cbb2fb2bc2ee8.tar.gz vmime-f9913fa28a27f23fde2d4956c62cbb2fb2bc2ee8.zip |
Boost/C++11 shared pointers.
Diffstat (limited to 'src/platforms/windows')
-rw-r--r-- | src/platforms/windows/windowsFile.cpp | 32 | ||||
-rw-r--r-- | src/platforms/windows/windowsHandler.cpp | 14 | ||||
-rw-r--r-- | src/platforms/windows/windowsSocket.cpp | 12 |
3 files changed, 29 insertions, 29 deletions
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 <vmime::utility::file> windowsFileSystemFactory::create(const vmime::utility::file::path& path) const +shared_ptr <vmime::utility::file> windowsFileSystemFactory::create(const vmime::utility::file::path& path) const { - return vmime::create <windowsFile>(path); + return make_shared <windowsFile>(path); } @@ -307,12 +307,12 @@ bool windowsFile::exists() const return false; } -ref <vmime::utility::file> windowsFile::getParent() const +shared_ptr <vmime::utility::file> windowsFile::getParent() const { if (m_path.isEmpty()) return NULL; else - return vmime::create <windowsFile>(m_path.getParent()); + return make_shared <windowsFile>(m_path.getParent()); } void windowsFile::rename(const path& newName) @@ -333,19 +333,19 @@ void windowsFile::remove() windowsFileSystemFactory::reportError(m_path, GetLastError()); } -ref <vmime::utility::fileWriter> windowsFile::getFileWriter() +shared_ptr <vmime::utility::fileWriter> windowsFile::getFileWriter() { - return vmime::create <windowsFileWriter>(m_path, m_nativePath); + return make_shared <windowsFileWriter>(m_path, m_nativePath); } -ref <vmime::utility::fileReader> windowsFile::getFileReader() +shared_ptr <vmime::utility::fileReader> windowsFile::getFileReader() { - return vmime::create <windowsFileReader>(m_path, m_nativePath); + return make_shared <windowsFileReader>(m_path, m_nativePath); } -ref <vmime::utility::fileIterator> windowsFile::getFiles() const +shared_ptr <vmime::utility::fileIterator> windowsFile::getFiles() const { - return vmime::create <windowsFileIterator>(m_path, m_nativePath); + return make_shared <windowsFileIterator>(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 <vmime::utility::file> windowsFileIterator::nextElement() +shared_ptr <vmime::utility::file> windowsFileIterator::nextElement() { - ref <vmime::utility::file> pFile = vmime::create <windowsFile> + shared_ptr <vmime::utility::file> pFile = make_shared <windowsFile> (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 <vmime::utility::inputStream> windowsFileReader::getInputStream() +shared_ptr <vmime::utility::inputStream> windowsFileReader::getInputStream() { HANDLE hFile = CreateFile( m_nativePath.c_str(), @@ -442,7 +442,7 @@ ref <vmime::utility::inputStream> windowsFileReader::getInputStream() NULL); if (hFile == INVALID_HANDLE_VALUE) windowsFileSystemFactory::reportError(m_path, GetLastError()); - return vmime::create <windowsFileReaderInputStream>(m_path, hFile); + return make_shared <windowsFileReaderInputStream>(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 <vmime::utility::outputStream> windowsFileWriter::getOutputStream() +shared_ptr <vmime::utility::outputStream> windowsFileWriter::getOutputStream() { HANDLE hFile = CreateFile( m_nativePath.c_str(), @@ -517,7 +517,7 @@ ref <vmime::utility::outputStream> windowsFileWriter::getOutputStream() NULL); if (hFile == INVALID_HANDLE_VALUE) windowsFileSystemFactory::reportError(m_path, GetLastError()); - return vmime::create <windowsFileWriterOutputStream>(m_path, hFile); + return make_shared <windowsFileWriterOutputStream>(m_path, hFile); } windowsFileWriterOutputStream::windowsFileWriterOutputStream(const vmime::utility::file::path& path, HANDLE hFile) diff --git a/src/platforms/windows/windowsHandler.cpp b/src/platforms/windows/windowsHandler.cpp index d4027801..5b9c37ce 100644 --- a/src/platforms/windows/windowsHandler.cpp +++ b/src/platforms/windows/windowsHandler.cpp @@ -57,10 +57,10 @@ windowsHandler::windowsHandler() WSAStartup(MAKEWORD(1, 1), &wsaData); #if VMIME_HAVE_MESSAGING_FEATURES - m_socketFactory = vmime::create <windowsSocketFactory>(); + m_socketFactory = make_shared <windowsSocketFactory>(); #endif #if VMIME_HAVE_FILESYSTEM_FEATURES - m_fileSysFactory = vmime::create <windowsFileSystemFactory>(); + m_fileSysFactory = make_shared <windowsFileSystemFactory>(); #endif } @@ -274,7 +274,7 @@ unsigned int windowsHandler::getThreadId() const #if VMIME_HAVE_MESSAGING_FEATURES -ref <vmime::net::socketFactory> windowsHandler::getSocketFactory() +shared_ptr <vmime::net::socketFactory> windowsHandler::getSocketFactory() { return m_socketFactory; } @@ -284,13 +284,13 @@ ref <vmime::net::socketFactory> windowsHandler::getSocketFactory() #if VMIME_HAVE_FILESYSTEM_FEATURES -ref <vmime::utility::fileSystemFactory> windowsHandler::getFileSystemFactory() +shared_ptr <vmime::utility::fileSystemFactory> windowsHandler::getFileSystemFactory() { return m_fileSysFactory; } -ref <vmime::utility::childProcessFactory> windowsHandler::getChildProcessFactory() +shared_ptr <vmime::utility::childProcessFactory> windowsHandler::getChildProcessFactory() { // TODO: Not implemented return (NULL); @@ -314,9 +314,9 @@ void windowsHandler::generateRandomBytes(unsigned char* buffer, const unsigned i } -ref <utility::sync::criticalSection> windowsHandler::createCriticalSection() +shared_ptr <utility::sync::criticalSection> windowsHandler::createCriticalSection() { - return vmime::create <windowsCriticalSection>(); + return make_shared <windowsCriticalSection>(); } diff --git a/src/platforms/windows/windowsSocket.cpp b/src/platforms/windows/windowsSocket.cpp index dc932965..502d1067 100644 --- a/src/platforms/windows/windowsSocket.cpp +++ b/src/platforms/windows/windowsSocket.cpp @@ -45,7 +45,7 @@ namespace windows { // windowsSocket // -windowsSocket::windowsSocket(ref <vmime::net::timeoutHandler> th) +windowsSocket::windowsSocket(shared_ptr <vmime::net::timeoutHandler> th) : m_timeoutHandler(th), m_desc(INVALID_SOCKET), m_status(0) { WSAData wsaData; @@ -438,15 +438,15 @@ void windowsSocket::waitForData(const WaitOpType t, bool& timedOut) // posixSocketFactory // -ref <vmime::net::socket> windowsSocketFactory::create() +shared_ptr <vmime::net::socket> windowsSocketFactory::create() { - ref <vmime::net::timeoutHandler> th = NULL; - return vmime::create <windowsSocket>(th); + shared_ptr <vmime::net::timeoutHandler> th = NULL; + return make_shared <windowsSocket>(th); } -ref <vmime::net::socket> windowsSocketFactory::create(ref <vmime::net::timeoutHandler> th) +shared_ptr <vmime::net::socket> windowsSocketFactory::create(shared_ptr <vmime::net::timeoutHandler> th) { - return vmime::create <windowsSocket>(th); + return make_shared <windowsSocket>(th); } } // posix |