// Copyright (c) 2006, 2007 Julio M. Merino Vidal // Copyright (c) 2008 Ilya Sokolov, Boris Schaeling // Copyright (c) 2009 Boris Schaeling // Copyright (c) 2010 Felipe Tanus, Boris Schaeling // Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROCESS_START_IN_DIR_HPP #define BOOST_PROCESS_START_IN_DIR_HPP #include #include #include #include #if defined (BOOST_POSIX_API) #include #elif defined (BOOST_WINDOWS_API) #include #endif #include #include #include /** \file boost/process/start_dir.hpp * Header which provides the start_dir property, which allows to set the directory the process shall be started in. \xmlonly namespace boost { namespace process { unspecified start_dir; } } \endxmlonly */ namespace boost { namespace process { namespace detail { struct start_dir_ { constexpr start_dir_() {}; template api::start_dir_init operator()(const std::basic_string & st) const {return {st}; } template api::start_dir_init operator()(std::basic_string && s) const {return {std::move(s)}; } template api::start_dir_init operator()(const Char* s) const {return {s}; } api::start_dir_init operator()(const boost::filesystem::path & st) const {return {st.native()}; } template api::start_dir_init operator= (const std::basic_string & st) const {return {st}; } template api::start_dir_init operator= (std::basic_string && s) const {return {std::move(s)}; } template api::start_dir_init operator= (const Char* s) const {return {s}; } api::start_dir_init operator= (const boost::filesystem::path & st) const {return {st.native()}; } }; template<> struct is_wchar_t> : std::true_type {}; template<> struct char_converter> { static api::start_dir_init conv(const api::start_dir_init & in) { return api::start_dir_init{::boost::process::detail::convert(in.str())}; } }; template<> struct char_converter> { static api::start_dir_init conv(const api::start_dir_init & in) { return api::start_dir_init{::boost::process::detail::convert(in.str())}; } }; } /** To set the start dir, the `start_dir` property is provided. The valid operations are the following: \code{.cpp} start_dir=path start_dir(path) \endcode It can be used with `std::string`, `std::wstring` and `boost::filesystem::path`. */ constexpr ::boost::process::detail::start_dir_ start_dir; }} #endif