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/posix/posixChildProcess.cpp | |
parent | Per-protocol include files. (diff) | |
download | vmime-f9913fa28a27f23fde2d4956c62cbb2fb2bc2ee8.tar.gz vmime-f9913fa28a27f23fde2d4956c62cbb2fb2bc2ee8.zip |
Boost/C++11 shared pointers.
Diffstat (limited to 'src/platforms/posix/posixChildProcess.cpp')
-rw-r--r-- | src/platforms/posix/posixChildProcess.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/platforms/posix/posixChildProcess.cpp b/src/platforms/posix/posixChildProcess.cpp index 09119996..c4761624 100644 --- a/src/platforms/posix/posixChildProcess.cpp +++ b/src/platforms/posix/posixChildProcess.cpp @@ -32,8 +32,6 @@ #include "vmime/exception.hpp" -#include "vmime/utility/smartPtr.hpp" - #include <unistd.h> #include <string.h> #include <errno.h> @@ -49,9 +47,9 @@ namespace posix { // posixChildProcessFactory -ref <utility::childProcess> posixChildProcessFactory::create(const utility::file::path& path) const +shared_ptr <utility::childProcess> posixChildProcessFactory::create(const utility::file::path& path) const { - return vmime::create <posixChildProcess>(path); + return make_shared <posixChildProcess>(path); } @@ -215,7 +213,7 @@ private: posixChildProcess::posixChildProcess(const utility::file::path& path) : m_processPath(path), m_started(false), - m_stdIn(NULL), m_stdOut(NULL), m_pid(0), m_argArray(NULL) + m_stdIn(null), m_stdOut(null), m_pid(0), m_argArray(NULL) { m_pipe[0] = 0; m_pipe[1] = 0; @@ -319,7 +317,7 @@ void posixChildProcess::start(const std::vector <string> args, const int flags) if (flags & FLAG_REDIRECT_STDIN) { - m_stdIn = vmime::create <outputStreamPosixPipeAdapter>(m_pipe[1]); + m_stdIn = make_shared <outputStreamPosixPipeAdapter>(m_pipe[1]); } else { @@ -329,7 +327,7 @@ void posixChildProcess::start(const std::vector <string> args, const int flags) if (flags & FLAG_REDIRECT_STDOUT) { - m_stdOut = vmime::create <inputStreamPosixPipeAdapter>(m_pipe[0]); + m_stdOut = make_shared <inputStreamPosixPipeAdapter>(m_pipe[0]); } else { @@ -342,13 +340,13 @@ void posixChildProcess::start(const std::vector <string> args, const int flags) } -ref <utility::outputStream> posixChildProcess::getStdIn() +shared_ptr <utility::outputStream> posixChildProcess::getStdIn() { return (m_stdIn); } -ref <utility::inputStream> posixChildProcess::getStdOut() +shared_ptr <utility::inputStream> posixChildProcess::getStdOut() { return (m_stdOut); } @@ -377,8 +375,7 @@ void posixChildProcess::waitForFinish() { if (WEXITSTATUS(wstat) == 255) { - vmime::utility::auto_ptr <posixFileSystemFactory> pfsf - = new posixFileSystemFactory(); + std::auto_ptr <posixFileSystemFactory> pfsf(new posixFileSystemFactory()); throw exceptions::system_error("Could not execute '" + pfsf->pathToString(m_processPath) + "'"); |