Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-10 08:42:58

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/v1/detail/config.hpp>
0016 #include <boost/process/v1/detail/handler_base.hpp>
0017 #include <boost/process/v1/detail/traits/cmd_or_exe.hpp>
0018 #include <boost/process/v1/detail/traits/wchar_t.hpp>
0019 
0020 #if defined(BOOST_POSIX_API)
0021 #include <boost/process/v1/detail/posix/cmd.hpp>
0022 #elif defined(BOOST_WINDOWS_API)
0023 #include <boost/process/v1/detail/windows/cmd.hpp>
0024 #endif
0025 
0026 /** \file boost/process/cmd.hpp
0027  *
0028  *    This header provides the \xmlonly <globalname alt="boost::process::v1::cmd">cmd</globalname>\endxmlonly property.
0029  *
0030 \xmlonly
0031 <programlisting>
0032 namespace boost {
0033   namespace process { BOOST_PROCESS_V1_INLINE namespace v1 {
0034     <emphasis>unspecified</emphasis> <globalname alt="boost::process::v1::cmd">cmd</globalname>;
0035   }
0036 }
0037 </programlisting>
0038 \endxmlonly
0039 */
0040 
0041 namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { 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     {        return api::cmd_setter_<Char>(s);
0051     }
0052     template<typename Char>
0053     inline api::cmd_setter_<Char> operator= (const Char *s) const
0054     {
0055         return api::cmd_setter_<Char>(s);
0056     }
0057 
0058     template<typename Char>
0059     inline api::cmd_setter_<Char> operator()(const std::basic_string<Char> &s) const
0060     {
0061         return api::cmd_setter_<Char>(s);
0062     }
0063     template<typename Char>
0064     inline api::cmd_setter_<Char> operator= (const std::basic_string<Char> &s) const
0065     {
0066         return api::cmd_setter_<Char>(s);
0067     }
0068 };
0069 
0070 template<> struct is_wchar_t<api::cmd_setter_<wchar_t>> : std::true_type {};
0071 
0072 
0073 
0074 template<>
0075 struct char_converter<char, api::cmd_setter_<wchar_t>>
0076 {
0077     static api::cmd_setter_<char> conv(const api::cmd_setter_<wchar_t> & in)
0078     {
0079         return { ::boost::process::v1::detail::convert(in.str()) };
0080     }
0081 };
0082 
0083 template<>
0084 struct char_converter<wchar_t, api::cmd_setter_<char>>
0085 {
0086     static api::cmd_setter_<wchar_t> conv(const api::cmd_setter_<char> & in)
0087     {
0088         return { ::boost::process::v1::detail::convert(in.str()) };
0089     }
0090 };
0091 
0092 
0093 
0094 
0095 
0096 
0097 }
0098 
0099 
0100 /** The cmd property allows to explicitly set commands for the execution.
0101 
0102 The overload form applies when only one string is passed to a launching function.
0103 The string will be internally parsed and split at spaces.
0104 
0105 The following expressions are valid, with `value` being either a C-String or
0106 a `std::basic_string` with `char` or `wchar_t`.
0107 
0108 \code{.cpp}
0109 cmd="value";
0110 cmd(value);
0111 \endcode
0112 
0113 The property can only be used for assignments.
0114 
0115 
0116  */
0117 constexpr static ::boost::process::v1::detail::cmd_ cmd;
0118 
0119 }}}
0120 
0121 #endif