]>
Commit | Line | Data |
---|---|---|
b32b8144 FG |
1 | // Copyright (c) 2006, 2007 Julio M. Merino Vidal |
2 | // Copyright (c) 2008 Ilya Sokolov, Boris Schaeling | |
3 | // Copyright (c) 2009 Boris Schaeling | |
4 | // Copyright (c) 2010 Felipe Tanus, Boris Schaeling | |
5 | // Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling | |
6 | // Copyright (c) 2016 Klemens D. Morgenstern | |
7 | // | |
8 | // Distributed under the Boost Software License, Version 1.0. (See accompanying | |
9 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
10 | ||
11 | #ifndef BOOST_PROCESS_EXE_HPP | |
12 | #define BOOST_PROCESS_EXE_HPP | |
13 | ||
14 | #include <boost/process/detail/basic_cmd.hpp> | |
15 | ||
16 | /** \file boost/process/exe.hpp | |
17 | * | |
18 | * Header which provides the exe property. | |
19 | \xmlonly | |
20 | <programlisting> | |
21 | namespace boost { | |
22 | namespace process { | |
23 | <emphasis>unspecified</emphasis> <globalname alt="boost::process::exe">exe</globalname>; | |
24 | } | |
25 | } | |
26 | </programlisting> | |
27 | \endxmlonly | |
28 | */ | |
29 | namespace boost { namespace process { namespace detail { | |
30 | ||
31 | struct exe_ | |
32 | { | |
33 | template<typename Char> | |
34 | inline exe_setter_<Char> operator()(const Char *s) const | |
35 | { | |
36 | return exe_setter_<Char>(s); | |
37 | } | |
38 | template<typename Char> | |
39 | inline exe_setter_<Char> operator= (const Char *s) const | |
40 | { | |
41 | return exe_setter_<Char>(s); | |
42 | } | |
43 | ||
44 | template<typename Char> | |
45 | inline exe_setter_<Char> operator()(const std::basic_string<Char> &s) const | |
46 | { | |
47 | return exe_setter_<Char>(s); | |
48 | } | |
49 | template<typename Char> | |
50 | inline exe_setter_<Char> operator= (const std::basic_string<Char> &s) const | |
51 | { | |
52 | return exe_setter_<Char>(s); | |
53 | } | |
54 | }; | |
55 | ||
56 | } | |
57 | ||
58 | /** The exe property allows to explicitly set the executable. | |
59 | ||
60 | The overload form applies when to the first, when several strings are passed to a launching | |
61 | function. | |
62 | ||
63 | The following expressions are valid, with `value` being either a C-String or | |
64 | a `std::basic_string` with `char` or `wchar_t` or a `boost::filesystem::path`. | |
65 | ||
66 | \code{.cpp} | |
67 | exe="value"; | |
68 | exe(value); | |
69 | \endcode | |
70 | ||
71 | The property can only be used for assignments. | |
72 | ||
73 | ||
74 | */ | |
75 | constexpr boost::process::detail::exe_ exe{}; | |
76 | ||
77 | }} | |
78 | ||
79 | #endif |