Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:50:14

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_EXE_HPP
0012 #define BOOST_PROCESS_EXE_HPP
0013 
0014 #include <boost/process/detail/basic_cmd.hpp>
0015 
0016 /** \file boost/process/exe.hpp
0017  *
0018  *    Header which provides the exe property.
0019 \xmlonly
0020 <programlisting>
0021 namespace boost {
0022   namespace process {
0023     <emphasis>unspecified</emphasis> <globalname alt="boost::process::exe">exe</globalname>;
0024   }
0025 }
0026 </programlisting>
0027 \endxmlonly
0028  */
0029 namespace boost {
0030 namespace filesystem { class path; }
0031 
0032 namespace process {
0033 
0034 namespace detail {
0035 
0036 struct exe_
0037 {
0038     template<typename = void>
0039     inline exe_setter_<typename boost::process::filesystem::path::value_type> operator()(const boost::process::filesystem::path & pth) const
0040     {
0041         return exe_setter_<typename boost::process::filesystem::path::value_type>(pth.native());
0042     }
0043 
0044     template<typename = void>
0045     inline exe_setter_<typename boost::process::filesystem::path::value_type> operator=(const boost::process::filesystem::path & pth) const
0046     {
0047         return exe_setter_<typename boost::process::filesystem::path::value_type>(pth.native());
0048     }
0049 
0050 
0051     template<typename Char>
0052     inline exe_setter_<Char> operator()(const Char *s) const
0053     {
0054         return exe_setter_<Char>(s);
0055     }
0056     template<typename Char>
0057     inline exe_setter_<Char> operator= (const Char *s) const
0058     {
0059         return exe_setter_<Char>(s);
0060     }
0061 
0062     template<typename Char>
0063     inline exe_setter_<Char> operator()(const std::basic_string<Char> &s) const
0064     {
0065         return exe_setter_<Char>(s);
0066     }
0067     template<typename Char>
0068     inline exe_setter_<Char> operator= (const std::basic_string<Char> &s) const
0069     {
0070         return exe_setter_<Char>(s);
0071     }
0072 };
0073 
0074 }
0075 
0076 /** The exe property allows to explicitly set the executable.
0077 
0078 The overload form applies when to the first, when several strings are passed to a launching
0079 function.
0080 
0081 The following expressions are valid, with `value` being either a C-String or
0082 a `std::basic_string` with `char` or `wchar_t` or a `boost::process::filesystem::path`.
0083 
0084 \code{.cpp}
0085 exe="value";
0086 exe(value);
0087 \endcode
0088 
0089 The property can only be used for assignments.
0090 
0091 
0092  */
0093 constexpr boost::process::detail::exe_ exe{};
0094 
0095 }}
0096 
0097 #endif