123456789101112131415161718192021222324252627282930313233343536373839 |
- #ifndef BOOST_PROCESS_DETAIL_POSIX_START_DIR_HPP
- #define BOOST_PROCESS_DETAIL_POSIX_START_DIR_HPP
- #include <boost/process/detail/posix/handler.hpp>
- #include <string>
- #include <unistd.h>
- #include <boost/core/ignore_unused.hpp>
- namespace boost { namespace process { namespace detail { namespace posix {
- template<typename Char>
- struct start_dir_init : handler_base_ext
- {
- typedef Char value_type;
- typedef std::basic_string<value_type> string_type;
- start_dir_init(string_type s) : s_(std::move(s)) {}
- template <class PosixExecutor>
- void on_exec_setup(PosixExecutor&) const
- {
- boost::ignore_unused(::chdir(s_.c_str()));
- }
- const string_type & str() const {return s_;}
- private:
- string_type s_;
- };
- }}}}
- #endif
|