Skip to content

Commit 5b5c67b

Browse files
moved v1 to v1 inline namespace.
1 parent 7b27dc4 commit 5b5c67b

File tree

150 files changed

+1002
-933
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+1002
-933
lines changed

Diff for: doc/v1/design.qbk

+3-3
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ but the one of the launching process, not the one passed to the child process.]
7575
The simplest form to extend functionality is to provide another handler, which
7676
will be called on the respective events on process launching. The names are:
7777

78-
*`boost::process::on_setup`
79-
*`boost::process::on_error`
80-
*`boost::process::on_success`
78+
*`boost::process::v1::on_setup`
79+
*`boost::process::v1::on_error`
80+
*`boost::process::v1::on_success`
8181

8282

8383
As an example:

Diff for: doc/v1/extend.qbk

+26-26
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
1-
[def __on_exit__ [globalref boost::process::on_exit on_exit]]
2-
[def __on_success__ [globalref boost::process::extend::on_success ex::on_success]]
3-
[def __child__ [classref boost::process::child child]]
4-
[def __handler__ [classref boost::process::extend::handler handler]]
5-
[def __on_success__ [memberref boost::process::extend::handler::on_success on_success]]
6-
[def __posix_executor__ [classref boost::process::extend::posix_executor ex::posix_executor]]
7-
[def __windows_executor__ [classref boost::process::extend::windows_executor ex::windows_executor]]
1+
[def __on_exit__ [globalref boost::process::v1::on_exit on_exit]]
2+
[def __on_success__ [globalref boost::process::v1::extend::on_success ex::on_success]]
3+
[def __child__ [classref boost::process::v1::child child]]
4+
[def __handler__ [classref boost::process::v1::extend::handler handler]]
5+
[def __on_success__ [memberref boost::process::v1::extend::handler::on_success on_success]]
6+
[def __posix_executor__ [classref boost::process::v1::extend::posix_executor ex::posix_executor]]
7+
[def __windows_executor__ [classref boost::process::v1::extend::windows_executor ex::windows_executor]]
88
[def __io_context__ [@http://www.boost.org/doc/libs/release/doc/html/boost_asio/reference/io_context.html boost::asio::io_context]]
9-
[def __require_io_context__ [classref boost::process::extend::require_io_context ex::require_io_context]]
10-
[def __async_handler__ [classref boost::process::extend::async_handler ex::async_handler]]
11-
[def __get_io_context__ [funcref boost::process::extend::get_io_context ex::get_io_context]]
9+
[def __require_io_context__ [classref boost::process::v1::extend::require_io_context ex::require_io_context]]
10+
[def __async_handler__ [classref boost::process::v1::extend::async_handler ex::async_handler]]
11+
[def __get_io_context__ [funcref boost::process::v1::extend::get_io_context ex::get_io_context]]
1212

1313
[section:extend Extensions]
1414
To extend the library, the header [headerref boost/process/extend.hpp extend] is provided.
1515

1616
It only provides the explicit style for custom properties, but no implicit style.
1717

1818
What this means is, that a custom initializer can be implemented, a reference which can be passed to one of the launching functions.
19-
If a class inherits [classref boost::process::extend::handler] it will be regarded as an initializer and thus directly put into the sequence
19+
If a class inherits [classref boost::process::v1::extend::handler] it will be regarded as an initializer and thus directly put into the sequence
2020
the executor gets passed.
2121

2222
[section:structure Structure]
2323

2424
The executor calls different handlers of the initializers during the process launch.
2525
The basic structure consists of three functions, as given below:
2626

27-
* [globalref boost::process::extend::on_setup on_setup]
28-
* [globalref boost::process::extend::on_error on_error]
29-
* [globalref boost::process::extend::on_success on_success]
27+
* [globalref boost::process::v1::extend::on_setup on_setup]
28+
* [globalref boost::process::v1::extend::on_error on_error]
29+
* [globalref boost::process::v1::extend::on_success on_success]
3030

3131
'''
3232
<imagedata fileref="boost_process/windows_exec.svg"/>
3333
'''
3434

3535
Additionally posix provides three more handlers, listed below:
3636

37-
* [globalref boost::process::extend::on_fork_error on_fork_error]
38-
* [globalref boost::process::extend::on_exec_setup on_exec_setup]
39-
* [globalref boost::process::extend::on_exec_error on_exec_error]
37+
* [globalref boost::process::v1::extend::on_fork_error on_fork_error]
38+
* [globalref boost::process::v1::extend::on_exec_setup on_exec_setup]
39+
* [globalref boost::process::v1::extend::on_exec_error on_exec_error]
4040

41-
For more information see the reference of [classref boost::process::extend::posix_executor posix_executor].
41+
For more information see the reference of [classref boost::process::v1::extend::posix_executor posix_executor].
4242

4343
[endsect]
4444
[section:simple Simple extensions]
@@ -55,8 +55,8 @@ __child__ c("foo", __on_success__=[](auto & exec) {std::cout << "hello world" <<
5555

5656
Considering that lambdas can also capture values, data can easily be shared between handlers.
5757

58-
To see which members the executor has, refer to [classref boost::process::extend::windows_executor windows_executor]
59-
and [classref boost::process::extend::posix_executor posix_executor].
58+
To see which members the executor has, refer to [classref boost::process::v1::extend::windows_executor windows_executor]
59+
and [classref boost::process::v1::extend::posix_executor posix_executor].
6060

6161
[note Combined with __on_exit__ this can also handle the process exit.]
6262

@@ -67,7 +67,7 @@ and [classref boost::process::extend::posix_executor posix_executor].
6767
[section:handler Handler Types]
6868

6969
Since the previous example is in a functional style, it is not very reusable.
70-
To solve that problem, the [classref boost::process::extend::handler handler] has an alias in the `boost::process::extend` namespace, to be inherited.
70+
To solve that problem, the [classref boost::process::v1::extend::handler handler] has an alias in the `boost::process::v1::extend` namespace, to be inherited.
7171
So let's implement the hello world example in a class.
7272

7373
```
@@ -86,7 +86,7 @@ __child__ c("foo", hello_world());
8686

8787
[note The implementation is done via overloading, not overriding.]
8888

89-
Every handler not implemented defaults to [classref boost::process::extend::handler handler], where an empty handler is defined for each event.
89+
Every handler not implemented defaults to [classref boost::process::v1::extend::handler handler], where an empty handler is defined for each event.
9090

9191
[endsect]
9292

@@ -108,11 +108,11 @@ struct async_foo : __handler__, __require_io_context__
108108
}
109109
};
110110
```
111-
[note Inheriting [globalref boost::process::extend::require_io_context require_io_context] is necessary, so [funcref boost::process::system system] provides one.]
111+
[note Inheriting [globalref boost::process::v1::extend::require_io_context require_io_context] is necessary, so [funcref boost::process::v1::system system] provides one.]
112112

113113
Additionally the handler can provide a function that is invoked when the child process exits. This is done through __async_handler__.
114114

115-
[note [globalref boost::process::extend::async_handler async_handler] implies [globalref boost::process::extend::require_io_context require_io_context] .]
115+
[note [globalref boost::process::v1::extend::async_handler async_handler] implies [globalref boost::process::v1::extend::require_io_context require_io_context] .]
116116

117117
```
118118
struct async_bar : __handler, __async_handler__
@@ -131,7 +131,7 @@ struct async_bar : __handler, __async_handler__
131131
```
132132

133133

134-
[caution `on_exit_handler` does not default and is always required when [classref boost::process::extend::async_handler async_handler] is inherited. ]
134+
[caution `on_exit_handler` does not default and is always required when [classref boost::process::v1::extend::async_handler async_handler] is inherited. ]
135135

136136
[caution `on_exit_handler` uses `boost::asio::signal_set` to listen for SIGCHLD on posix. The application must not also register a signal handler for SIGCHLD using functions such as `signal()` or `sigaction()` (but using `boost::asio::signal_set` is fine). ]
137137

@@ -156,7 +156,7 @@ auto set_error = [](auto & exec)
156156
__child__ c("foo", on_setup=set_error);
157157
```
158158

159-
Since we do not specify the error-handling mode in this example, this will throw [classref boost::process::process_error process_error].
159+
Since we do not specify the error-handling mode in this example, this will throw [classref boost::process::v1::process_error process_error].
160160

161161
[endsect]
162162

Diff for: doc/v1/introduction.qbk

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ Boost.Process is a library to manage system processes. It can be used to:
1010

1111
Here's a simple example of how to start a program with Boost.Process:
1212

13-
[def ipstream [classref boost::process::ipstream ipstream]]
14-
[def system [funcref boost::process::system system]]
15-
[def std_out [globalref boost::process::std_out std_out]]
16-
[def child [globalref boost::process::child child]]
13+
[def ipstream [classref boost::process::v1::ipstream ipstream]]
14+
[def system [funcref boost::process::v1::system system]]
15+
[def std_out [globalref boost::process::v1::std_out std_out]]
16+
[def child [globalref boost::process::v1::child child]]
1717
[def boost/process.hpp [headerref boost/process.hpp boost/process.hpp]]
1818
[def std::string [@http://en.cppreference.com/w/cpp/string/basic_string std::string]]
1919
[def std::getline [@http://en.cppreference.com/w/cpp/string/basic_string/getline std::getline]]

Diff for: doc/v1/posix_pseudocode.xml

+20-20
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,59 @@
11
<?xml version="1.0" standalone="yes"?>
22
<programlisting>
33
for (auto &amp; s : seq)
4-
s.<methodname alt="boost::process::extend::handler::on_setup">on_setup</methodname>(*this);
4+
s.<methodname alt="boost::process::v1::extend::handler::on_setup">on_setup</methodname>(*this);
55

6-
if (<methodname alt="boost::process::extend::posix_executor::error">error</methodname>())
6+
if (<methodname alt="boost::process::v1::extend::posix_executor::error">error</methodname>())
77
{
88
for (auto &amp; s : seq)
9-
s.<methodname alt="boost::process::extend::handler::on_error">on_error</methodname>(*this, <methodname alt="boost::process::extend::posix_executor::error">error</methodname>());
10-
return <classname alt="boost::process::child">child</classname>();
9+
s.<methodname alt="boost::process::v1::extend::handler::on_error">on_error</methodname>(*this, <methodname alt="boost::process::v1::extend::posix_executor::error">error</methodname>());
10+
return <classname alt="boost::process::v1::child">child</classname>();
1111
}
1212

1313
pid = <ulink url="http://pubs.opengroup.org/onlinepubs/009695399/functions/fork.html">fork()</ulink>
14-
<methodname alt="boost::process::extend::handler::on_setup">on_setup</methodname>(*this);
14+
<methodname alt="boost::process::v1::extend::handler::on_setup">on_setup</methodname>(*this);
1515

1616
if (pid == -1) //fork error
1717
{
18-
<methodname alt="boost::process::extend::posix_executor::set_error">set_error</methodname>(<functionname alt="boost::process::extend::get_last_error">get_last_error</functionname>());
18+
<methodname alt="boost::process::v1::extend::posix_executor::set_error">set_error</methodname>(<functionname alt="boost::process::v1::extend::get_last_error">get_last_error</functionname>());
1919
for (auto &amp; s : seq)
20-
s.<methodname alt="boost::process::extend::handler::on_fork_error">on_fork_error</methodname>(*this, <methodname alt="boost::process::extend::posix_executor::error">error</methodname>());
20+
s.<methodname alt="boost::process::v1::extend::handler::on_fork_error">on_fork_error</methodname>(*this, <methodname alt="boost::process::v1::extend::posix_executor::error">error</methodname>());
2121
for (auto &amp; s : seq)
22-
s.<methodname alt="boost::process::extend::handler::on_error">on_error</methodname>(*this, <methodname alt="boost::process::extend::posix_executor::error">error</methodname>());
23-
return <classname alt="boost::process::child">child</classname>()
22+
s.<methodname alt="boost::process::v1::extend::handler::on_error">on_error</methodname>(*this, <methodname alt="boost::process::v1::extend::posix_executor::error">error</methodname>());
23+
return <classname alt="boost::process::v1::child">child</classname>()
2424
}
2525
else if (pid == 0) //child process
2626
{
2727
for (auto &amp; s : seq)
28-
s.<methodname alt="boost::process::extend::handler::on_exec_setup">on_exec_setup</methodname>(*this);
28+
s.<methodname alt="boost::process::v1::extend::handler::on_exec_setup">on_exec_setup</methodname>(*this);
2929
<ulink url="http://pubs.opengroup.org/onlinepubs/009695399/functions/exec.html">execve</ulink>(exe, cmd_line, env);
30-
auto ec = <functionname alt="boost::process::extend::get_last_error">get_last_error</functionname>();
30+
auto ec = <functionname alt="boost::process::v1::extend::get_last_error">get_last_error</functionname>();
3131
for (auto &amp; s : seq)
32-
s.<methodname alt="boost::process::extend::handler::on_exec_error">on_exec_error</methodname>(*this);
32+
s.<methodname alt="boost::process::v1::extend::handler::on_exec_error">on_exec_error</methodname>(*this);
3333

3434
<emphasis>unspecified();</emphasis>//here the error is sent to the father process internally
3535

3636
<ulink url="http://en.cppreference.com/w/cpp/utility/program/exit">std::exit</ulink>(<ulink url="http://en.cppreference.com/w/c/program/EXIT_status">EXIT_FAILURE</ulink>);
37-
return <classname alt="boost::process::child">child</classname>(); //for C++ compliance
37+
return <classname alt="boost::process::v1::child">child</classname>(); //for C++ compliance
3838
}
3939

40-
<classname alt="boost::process::child">child</classname> c(pid, exit_code);
40+
<classname alt="boost::process::v1::child">child</classname> c(pid, exit_code);
4141

4242
<emphasis>unspecified();</emphasis>//here, we read the error from the child process
4343

44-
if (<methodname alt="boost::process::extend::posix_executor::error">error</methodname>())
44+
if (<methodname alt="boost::process::v1::extend::posix_executor::error">error</methodname>())
4545
for (auto &amp; s : seq)
46-
s.<methodname alt="boost::process::extend::handler::on_error">on_error</methodname>(*this, <methodname alt="boost::process::extend::posix_executor::error">error</methodname>());
46+
s.<methodname alt="boost::process::v1::extend::handler::on_error">on_error</methodname>(*this, <methodname alt="boost::process::v1::extend::posix_executor::error">error</methodname>());
4747
else
4848
for (auto &amp; s : seq)
49-
s.<methodname alt="boost::process::extend::handler::on_error">on_success</methodname>(*this);
49+
s.<methodname alt="boost::process::v1::extend::handler::on_error">on_success</methodname>(*this);
5050

5151
//now we check again, because an on_success handler might've errored.
52-
if (<methodname alt="boost::process::extend::posix_executor::error">error</methodname>())
52+
if (<methodname alt="boost::process::v1::extend::posix_executor::error">error</methodname>())
5353
{
5454
for (auto &amp; s : seq)
55-
s.<methodname alt="boost::process::extend::handler::on_error">on_error</methodname>(*this, <methodname alt="boost::process::extend::posix_executor::error">error</methodname>());
56-
return <classname alt="boost::process::child">child</classname>();
55+
s.<methodname alt="boost::process::v1::extend::handler::on_error">on_error</methodname>(*this, <methodname alt="boost::process::v1::extend::posix_executor::error">error</methodname>());
56+
return <classname alt="boost::process::v1::child">child</classname>();
5757
}
5858
else
5959
return c;

0 commit comments

Comments
 (0)