File indexing completed on 2025-01-30 09:58:03
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_PROCESS_DETAIL_CMD_LINE_HPP
0012 #define BOOST_PROCESS_DETAIL_CMD_LINE_HPP
0013
0014 #include <boost/winapi/config.hpp>
0015 #include <boost/process/detail/config.hpp>
0016 #include <boost/process/detail/handler_base.hpp>
0017 #include <boost/process/detail/traits/cmd_or_exe.hpp>
0018 #include <boost/process/detail/traits/wchar_t.hpp>
0019
0020 #if defined(BOOST_POSIX_API)
0021 #include <boost/process/detail/posix/cmd.hpp>
0022 #elif defined(BOOST_WINDOWS_API)
0023 #include <boost/process/detail/windows/cmd.hpp>
0024 #endif
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041 namespace boost { namespace process { namespace detail {
0042
0043
0044 struct cmd_
0045 {
0046 constexpr cmd_() = default;
0047
0048 template<typename Char>
0049 inline api::cmd_setter_<Char> operator()(const Char *s) const
0050 {
0051 return api::cmd_setter_<Char>(s);
0052 }
0053 template<typename Char>
0054 inline api::cmd_setter_<Char> operator= (const Char *s) const
0055 {
0056 return api::cmd_setter_<Char>(s);
0057 }
0058
0059 template<typename Char>
0060 inline api::cmd_setter_<Char> operator()(const std::basic_string<Char> &s) const
0061 {
0062 return api::cmd_setter_<Char>(s);
0063 }
0064 template<typename Char>
0065 inline api::cmd_setter_<Char> operator= (const std::basic_string<Char> &s) const
0066 {
0067 return api::cmd_setter_<Char>(s);
0068 }
0069 };
0070
0071 template<> struct is_wchar_t<api::cmd_setter_<wchar_t>> : std::true_type {};
0072
0073
0074
0075 template<>
0076 struct char_converter<char, api::cmd_setter_<wchar_t>>
0077 {
0078 static api::cmd_setter_<char> conv(const api::cmd_setter_<wchar_t> & in)
0079 {
0080 return { ::boost::process::detail::convert(in.str()) };
0081 }
0082 };
0083
0084 template<>
0085 struct char_converter<wchar_t, api::cmd_setter_<char>>
0086 {
0087 static api::cmd_setter_<wchar_t> conv(const api::cmd_setter_<char> & in)
0088 {
0089 return { ::boost::process::detail::convert(in.str()) };
0090 }
0091 };
0092
0093
0094
0095
0096
0097
0098 }
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118 constexpr static ::boost::process::detail::cmd_ cmd;
0119
0120 }}
0121
0122 #endif