File indexing completed on 2025-01-18 09:50:07
0001
0002
0003
0004
0005
0006
0007 #ifndef BOOST_PROCESS_DETAIL_TRAITS_CMD_OR_EXE_HPP_
0008 #define BOOST_PROCESS_DETAIL_TRAITS_CMD_OR_EXE_HPP_
0009
0010 #include <string>
0011 #include <vector>
0012 #include <type_traits>
0013 #include <initializer_list>
0014 #include <boost/process/filesystem.hpp>
0015 #include <boost/process/detail/traits/decl.hpp>
0016 namespace boost { namespace process { namespace detail {
0017
0018 template<typename Char>
0019 struct cmd_or_exe_tag {};
0020
0021 struct shell_;
0022
0023
0024 template<> struct initializer_tag<const char* > { typedef cmd_or_exe_tag<char> type;};
0025 template<> struct initializer_tag<const wchar_t* > { typedef cmd_or_exe_tag<wchar_t> type;};
0026
0027 template<> struct initializer_tag<char* > { typedef cmd_or_exe_tag<char> type;};
0028 template<> struct initializer_tag<wchar_t* > { typedef cmd_or_exe_tag<wchar_t> type;};
0029
0030 template<std::size_t Size> struct initializer_tag<const char [Size]> { typedef cmd_or_exe_tag<char> type;};
0031 template<std::size_t Size> struct initializer_tag<const wchar_t [Size]> { typedef cmd_or_exe_tag<wchar_t> type;};
0032
0033 template<std::size_t Size> struct initializer_tag<const char (&)[Size]> { typedef cmd_or_exe_tag<char> type;};
0034 template<std::size_t Size> struct initializer_tag<const wchar_t (&)[Size]> { typedef cmd_or_exe_tag<wchar_t> type;};
0035
0036 template<> struct initializer_tag<std::basic_string<char >> { typedef cmd_or_exe_tag<char> type;};
0037 template<> struct initializer_tag<std::basic_string<wchar_t >> { typedef cmd_or_exe_tag<wchar_t> type;};
0038
0039 template<> struct initializer_tag<std::vector<std::basic_string<char >>> { typedef cmd_or_exe_tag<char> type;};
0040 template<> struct initializer_tag<std::vector<std::basic_string<wchar_t >>> { typedef cmd_or_exe_tag<wchar_t> type;};
0041
0042 template<> struct initializer_tag<std::initializer_list<std::basic_string<char >>> { typedef cmd_or_exe_tag<char> type;};
0043 template<> struct initializer_tag<std::initializer_list<std::basic_string<wchar_t >>> { typedef cmd_or_exe_tag<wchar_t> type;};
0044
0045 template<> struct initializer_tag<std::vector<char *>> { typedef cmd_or_exe_tag<char> type;};
0046 template<> struct initializer_tag<std::vector<wchar_t *>> { typedef cmd_or_exe_tag<wchar_t> type;};
0047
0048 template<> struct initializer_tag<std::initializer_list<char *>> { typedef cmd_or_exe_tag<char> type;};
0049 template<> struct initializer_tag<std::initializer_list<wchar_t *>> { typedef cmd_or_exe_tag<wchar_t> type;};
0050
0051 template<> struct initializer_tag<std::initializer_list<const char *>> { typedef cmd_or_exe_tag<char> type;};
0052 template<> struct initializer_tag<std::initializer_list<const wchar_t *>> { typedef cmd_or_exe_tag<wchar_t> type;};
0053
0054 template<> struct initializer_tag<shell_>
0055 {
0056 typedef cmd_or_exe_tag<typename boost::process::filesystem::path::value_type> type;
0057 };
0058
0059 template<> struct initializer_tag<boost::process::filesystem::path>
0060 {
0061 typedef cmd_or_exe_tag<typename boost::process::filesystem::path::value_type> type;
0062 };
0063
0064 template <typename Char>
0065 struct exe_setter_;
0066 template <typename Char, bool Append = false>
0067 struct arg_setter_;
0068
0069 template <typename Char, bool Append>
0070 struct initializer_tag<arg_setter_<Char, Append>> { typedef cmd_or_exe_tag<Char> type;};
0071
0072 template<typename Char> struct initializer_tag<exe_setter_<Char>> { typedef cmd_or_exe_tag<Char> type;};
0073
0074 template<>
0075 struct initializer_builder<cmd_or_exe_tag<char>>;
0076
0077 template<>
0078 struct initializer_builder<cmd_or_exe_tag<wchar_t>>;
0079
0080
0081 }}}
0082
0083
0084
0085 #endif