Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:50:06

0001 // Copyright (c) 2006, 2007 Julio M. Merino Vidal
0002 // Copyright (c) 2008 Ilya Sokolov, Boris Schaeling
0003 // Copyright (c) 2009 Boris Schaeling
0004 // Copyright (c) 2010 Felipe Tanus, Boris Schaeling
0005 // Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling
0006 //
0007 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0008 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0009 
0010 #ifndef BOOST_PROCESS_DETAIL_POSIX_START_DIR_HPP
0011 #define BOOST_PROCESS_DETAIL_POSIX_START_DIR_HPP
0012 
0013 #include <boost/process/detail/posix/handler.hpp>
0014 #include <string>
0015 #include <unistd.h>
0016 #include <boost/core/ignore_unused.hpp>
0017 
0018 namespace boost { namespace process { namespace detail { namespace posix {
0019 
0020 template<typename Char>
0021 struct start_dir_init : handler_base_ext
0022 {
0023     typedef Char value_type;
0024     typedef std::basic_string<value_type> string_type;
0025     start_dir_init(string_type s) : s_(std::move(s)) {}
0026 
0027     template <class PosixExecutor>
0028     void on_exec_setup(PosixExecutor&) const
0029     {
0030         boost::ignore_unused(::chdir(s_.c_str()));
0031     }
0032     const string_type & str() const {return s_;}
0033 private:
0034     string_type s_;
0035 };
0036 
0037 }}}}
0038 
0039 #endif