Back to home page

EIC code displayed by LXR

 
 

    


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

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_START_IN_DIR_HPP
0011 #define BOOST_PROCESS_START_IN_DIR_HPP
0012 
0013 #include <boost/process/detail/config.hpp>
0014 #include <boost/process/detail/handler.hpp>
0015 #include <boost/process/locale.hpp>
0016 #include <boost/process/detail/traits/wchar_t.hpp>
0017 
0018 #if defined (BOOST_POSIX_API)
0019 #include <boost/process/detail/posix/start_dir.hpp>
0020 #elif defined (BOOST_WINDOWS_API)
0021 #include <boost/process/detail/windows/start_dir.hpp>
0022 #endif
0023 
0024 #include <boost/process/detail/config.hpp>
0025 #include <string>
0026 #include <boost/process/filesystem.hpp>
0027 
0028 /** \file boost/process/start_dir.hpp
0029  *
0030 Header which provides the start_dir property, which allows to set the directory
0031 the process shall be started in.
0032 \xmlonly
0033 <programlisting>
0034 namespace boost {
0035   namespace process {
0036     <emphasis>unspecified</emphasis> <globalname alt="boost::process::start_dir">start_dir</globalname>;
0037   }
0038 }
0039 </programlisting>
0040 \endxmlonly
0041 
0042  */
0043 
0044 namespace boost { namespace process { namespace detail {
0045 
0046 struct start_dir_
0047 {
0048     constexpr start_dir_() {};
0049 
0050     template<typename Char>
0051     api::start_dir_init<Char> operator()(const std::basic_string<Char> & st) const {return {st}; }
0052     template<typename Char>
0053     api::start_dir_init<Char> operator()(std::basic_string<Char> && s) const {return {std::move(s)}; }
0054     template<typename Char>
0055     api::start_dir_init<Char> operator()(const Char* s)                const {return {s}; }
0056     api::start_dir_init<typename boost::process::filesystem::path::value_type>
0057                               operator()(const boost::process::filesystem::path & st) const {return {st.native()}; }
0058 
0059     template<typename Char>
0060     api::start_dir_init<Char> operator= (const std::basic_string<Char> & st) const {return {st}; }
0061     template<typename Char>
0062     api::start_dir_init<Char> operator= (std::basic_string<Char> && s) const {return {std::move(s)}; }
0063     template<typename Char>
0064     api::start_dir_init<Char> operator= (const Char* s)                const {return {s}; }
0065     api::start_dir_init<typename boost::process::filesystem::path::value_type>
0066                               operator= (const boost::process::filesystem::path & st) const {return {st.native()}; }
0067 
0068 };
0069 
0070 template<> struct is_wchar_t<api::start_dir_init<wchar_t>> : std::true_type {};
0071 
0072 template<>
0073 struct char_converter<char, api::start_dir_init<wchar_t>>
0074 {
0075     static api::start_dir_init<char> conv(const api::start_dir_init<wchar_t> & in)
0076     {
0077         return api::start_dir_init<char>{::boost::process::detail::convert(in.str())};
0078     }
0079 };
0080 
0081 template<>
0082 struct char_converter<wchar_t, api::start_dir_init<char>>
0083 {
0084     static api::start_dir_init<wchar_t> conv(const api::start_dir_init<char> & in)
0085     {
0086         return api::start_dir_init<wchar_t>{::boost::process::detail::convert(in.str())};
0087     }
0088 };
0089 
0090 }
0091 
0092 /**
0093 
0094 To set the start dir, the `start_dir` property is provided.
0095 
0096 The valid operations are the following:
0097 
0098 \code{.cpp}
0099 start_dir=path
0100 start_dir(path)
0101 \endcode
0102 
0103 It can be used with `std::string`, `std::wstring` and `boost::process::filesystem::path`.
0104 
0105 
0106  */
0107 constexpr ::boost::process::detail::start_dir_ start_dir;
0108 
0109 }}
0110 
0111 #endif