|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r62882 - sandbox/SOC/2010/process/libs/process/example
From: fotanus_at_[hidden]
Date: 2010-06-12 18:24:46
Author: fotanus
Date: 2010-06-12 18:24:45 EDT (Sat, 12 Jun 2010)
New Revision: 62882
URL: http://svn.boost.org/trac/boost/changeset/62882
Log:
Fix examples after design update (virtual streams)
Text files modified:
sandbox/SOC/2010/process/libs/process/example/create_process.cpp | 9 +++++++--
sandbox/SOC/2010/process/libs/process/example/read_async_from_child.cpp | 2 +-
sandbox/SOC/2010/process/libs/process/example/write_async_to_child.cpp | 2 +-
sandbox/SOC/2010/process/libs/process/example/write_to_child.cpp | 2 +-
4 files changed, 10 insertions(+), 5 deletions(-)
Modified: sandbox/SOC/2010/process/libs/process/example/create_process.cpp
==============================================================================
--- sandbox/SOC/2010/process/libs/process/example/create_process.cpp (original)
+++ sandbox/SOC/2010/process/libs/process/example/create_process.cpp 2010-06-12 18:24:45 EDT (Sat, 12 Jun 2010)
@@ -1,4 +1,4 @@
-//
+/
// Boost.Process
// ~~~~~~~~~~~~~
//
@@ -27,6 +27,11 @@
context ctx;
ctx.environment.insert(std::make_pair("NEW_ENV_VARIABLE", "VALUE"));
- ctx.stdin_behavior = stream_behavior::close;
+
+ ctx.stdin_behavior = boost::make_shared<close>(close());
+ ctx.stdout_behavior = boost::make_shared<close>(close());
child c3 = create_child(find_executable_in_path("hostname"), args, ctx);
+
+ int x;
+ std::cin >> x;
}
Modified: sandbox/SOC/2010/process/libs/process/example/read_async_from_child.cpp
==============================================================================
--- sandbox/SOC/2010/process/libs/process/example/read_async_from_child.cpp (original)
+++ sandbox/SOC/2010/process/libs/process/example/read_async_from_child.cpp 2010-06-12 18:24:45 EDT (Sat, 12 Jun 2010)
@@ -30,7 +30,7 @@
{
std::string exe = find_executable_in_path("hostname");
context ctx;
- ctx.stdout_behavior = capture;
+ ctx.stdout_behavior = boost::make_shared<capture>(capture(capture::output_stream)); ;
child c = create_child(exe, ctx);
pistream &is = c.get_stdout();
pipe read_end(ioservice, is.native());
Modified: sandbox/SOC/2010/process/libs/process/example/write_async_to_child.cpp
==============================================================================
--- sandbox/SOC/2010/process/libs/process/example/write_async_to_child.cpp (original)
+++ sandbox/SOC/2010/process/libs/process/example/write_async_to_child.cpp 2010-06-12 18:24:45 EDT (Sat, 12 Jun 2010)
@@ -27,7 +27,7 @@
{
std::string exe = find_executable_in_path("ftp");
context ctx;
- ctx.stdin_behavior = capture;
+ ctx.stdin_behavior = boost::make_shared<capture>(capture(capture::input_stream)); ;
child c = create_child(exe, ctx);
postream &os = c.get_stdin();
pipe write_end(ioservice, os.native());
Modified: sandbox/SOC/2010/process/libs/process/example/write_to_child.cpp
==============================================================================
--- sandbox/SOC/2010/process/libs/process/example/write_to_child.cpp (original)
+++ sandbox/SOC/2010/process/libs/process/example/write_to_child.cpp 2010-06-12 18:24:45 EDT (Sat, 12 Jun 2010)
@@ -20,7 +20,7 @@
{
std::string exe = find_executable_in_path("ftp");
context ctx;
- ctx.stdin_behavior = capture;
+ ctx.stdin_behavior = boost::make_shared<capture>(capture(capture::input_stream));
child c = create_child(exe, ctx);
postream &os = c.get_stdin();
os << "quit" << std::endl;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk