File indexing completed on 2025-01-18 09:50:14
0001
0002
0003
0004
0005
0006
0007
0008
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
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
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
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107 constexpr ::boost::process::detail::start_dir_ start_dir;
0108
0109 }}
0110
0111 #endif