Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:58:03

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 // Copyright (c) 2016 Klemens D. Morgenstern
0007 //
0008 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0009 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
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 /** \file boost/process/cmd.hpp
0027  *
0028  *    This header provides the \xmlonly <globalname alt="boost::process::cmd">cmd</globalname>\endxmlonly property.
0029  *
0030 \xmlonly
0031 <programlisting>
0032 namespace boost {
0033   namespace process {
0034     <emphasis>unspecified</emphasis> <globalname alt="boost::process::cmd">cmd</globalname>;
0035   }
0036 }
0037 </programlisting>
0038 \endxmlonly
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 /** The cmd property allows to explicitly set commands for the execution.
0102 
0103 The overload form applies when only one string is passed to a launching function.
0104 The string will be internally parsed and split at spaces.
0105 
0106 The following expressions are valid, with `value` being either a C-String or
0107 a `std::basic_string` with `char` or `wchar_t`.
0108 
0109 \code{.cpp}
0110 cmd="value";
0111 cmd(value);
0112 \endcode
0113 
0114 The property can only be used for assignments.
0115 
0116 
0117  */
0118 constexpr static ::boost::process::detail::cmd_ cmd;
0119 
0120 }}
0121 
0122 #endif