diff --git a/CMakeLists.txt b/CMakeLists.txt index 930010e..3e1ec38 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,13 @@ cmake_minimum_required(VERSION 3.0.0) project (inclusive VERSION "0.0.1") -#set (CMAKE_CXX_STANDARD 14) -add_compile_options(-std=c++14) +if(MSVC) + set(CMAKE_CXX_STANDARD 14) + # avoid the boost warning, it will disable boost from using IOCP and newer APIs. + add_definitions(-D_WIN32_WINNT=0x0601) +else() + add_compile_options(-std=c++14) +endif() if(UNIX AND NOT APPLE) set(LINUX TRUE) @@ -22,17 +27,15 @@ find_package(Threads REQUIRED) # Boost -find_package(Boost 1.61 COMPONENTS system filesystem) -include_directories (AFTER ${Boost_INCLUDE_DIRS}) +add_definitions(-DBOOST_ASIO_NO_DEPRECATED) +find_package(Boost 1.73.0 COMPONENTS system filesystem process) +include_directories(AFTER ${Boost_INCLUDE_DIRS}) # Shippedwith add_subdirectory(deps/mstch) include_directories(${mstch_INCLUDE_DIR}) - -include_directories(AFTER ${CMAKE_CURRENT_LIST_DIR}/deps/boost-process/include) include_directories(AFTER ${CMAKE_CURRENT_LIST_DIR}/deps/nlohmann-json/src) - include_directories(BEFORE ${CMAKE_CURRENT_LIST_DIR}/src) add_executable(inglued src/inglued.cpp) target_link_libraries(inglued ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} mstch) diff --git a/deps/boost-process/.gitignore b/deps/boost-process/.gitignore deleted file mode 100644 index 4354fda..0000000 --- a/deps/boost-process/.gitignore +++ /dev/null @@ -1,34 +0,0 @@ -# Compiled Object files -*.slo -*.lo -*.o -*.obj - -# Compiled Dynamic libraries -*.so -*.dylib -*.dll - -# Compiled Static libraries -*.lai -*.la -*.a -*.lib - -# Executables -*.exe -*.out -*.app -/bin -/*/bin -/doc/autodoc.xml -/doc/html -/sparring_log.txt -/.cproject -/.project -/Doxyfile - -/notes.cpp -/notes_p.txt -.settings - diff --git a/deps/boost-process/.travis.yml b/deps/boost-process/.travis.yml deleted file mode 100644 index 2de669f..0000000 --- a/deps/boost-process/.travis.yml +++ /dev/null @@ -1,119 +0,0 @@ -# Use, modification, and distribution are -# subject to the Boost Software License, Version 1.0. (See accompanying -# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -# -# Copyright Antony Polukhin 2014-2016. - -# -# See https://svn.boost.org/trac/boost/wiki/TravisCoverals for description of this file -# and how it can be used with Boost libraries. -# -# File revision #6 - -env: - global: - # Autodetect Boost branch by using the following code: - BRANCH_TO_TEST=$TRAVIS_BRANCH - # or just directly specify it - - BRANCH_TO_TEST=$TRAVIS_BRANCH - - # Files, which coverage results must be ignored (files from other projects). - # Example: - IGNORE_COVERAGE='*/boost/progress.hpp */filesystem/src/*' - - IGNORE_COVERAGE='' - - # Explicitly remove the following library from Boost. This may be usefull, if you're for example running Travis - # from `Boost.DLL` repo, while Boost already has `dll`. - # - # By default is eaual to - BOOST_REMOVE=`basename $TRAVIS_BUILD_DIR` - # This will force to use local repo content, instead of the Boost's default - # not needed because process is not yet in boost. - - BOOST_REMOVE=process - - matrix: - - CXX_STANDARD=c++11 TOOLSET=gcc-5 - - CXX_STANDARD=c++1y TOOLSET=gcc-5 - - -############################################################################################################### -# From this point and below code is same for all the Boost libs -############################################################################################################### -sudo: false -language: cpp -compiler: - - gcc - -os: - - linux - -# Installing additional tools -addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - valgrind - - python-yaml - - gcc-5 - - g++-5 -# - lcov - - clang - -before_install: - # Set this to the name of the library - - PROJECT_TO_TEST=`basename $TRAVIS_BUILD_DIR` - - echo "Testing $PROJECT_TO_TEST" - # Cloning Boost libraries (fast nondeep cloning) - - BOOST=$HOME/boost-local - - git init $BOOST - - cd $BOOST - - if [ $(BRANCH_TO_TEST) = "master" ]; then - BOOST_BRANCH=master; - else BOOST_BRANCH=develop; fi - - git remote add --no-tags -t $BOOST_BRANCH origin https://github.com/boostorg/boost.git - - git fetch --depth=1 - - git checkout $BOOST_BRANCH - - git submodule update --init --merge - - git remote set-branches --add origin $BOOST_BRANCH - - git pull --recurse-submodules - - git submodule update --init - - git checkout $BOOST_BRANCH - - git submodule foreach "git reset --quiet --hard; git clean -fxd" - - git reset --hard; git clean -fxd - - git status - - echo "Removing $BOOST/libs/$BOOST_REMOVE" - - rm -rf $BOOST/libs/$BOOST_REMOVE - - mv $TRAVIS_BUILD_DIR/../$PROJECT_TO_TEST/ $BOOST/libs/$PROJECT_TO_TEST - - TRAVIS_BUILD_DIR=$BOOST/libs/$PROJECT_TO_TEST - - ./bootstrap.sh - - ./b2 headers - - cd $BOOST/libs/$PROJECT_TO_TEST/test - -script: - # `--coverage` flags required to generate coverage info for Coveralls - - ../../../b2 address-model=64 architecture=x86 testing.launcher=valgrind valgrind=on toolset=$TOOLSET cxxflags="--coverage -DBOOST_TRAVISCI_BUILD -std=$CXX_STANDARD" linkflags="--coverage" -sBOOST_BUILD_PATH=. - - ../../../b2 vfork address-model=64 architecture=x86 toolset=$TOOLSET cxxflags="--coverage -DBOOST_TRAVISCI_BUILD -std=$CXX_STANDARD" linkflags="--coverage" -sBOOST_BUILD_PATH=. -after_success: - # Copying Coveralls data to a separate folder - - mkdir -p $TRAVIS_BUILD_DIR/coverals - - find ../../../bin.v2/ -name "*.gcda" -exec cp "{}" $TRAVIS_BUILD_DIR/coverals/ \; - - find ../../../bin.v2/ -name "*.gcno" -exec cp "{}" $TRAVIS_BUILD_DIR/coverals/ \; - - # Preparing Coveralls data by changind data format to a readable one - - git clone https://github.com/linux-test-project/lcov.git lcov_dir - - GCOV_VERSION="" - - if [[ "$TOOLSET" == *"-"* ]]; then GCOV_VERSION="--gcov-tool gcov-${TOOLSET#*-}"; fi - - LCOV="$BOOST/libs/$PROJECT_TO_TEST/test/lcov_dir/bin/lcov $GCOV_VERSION" - - $LCOV --directory $TRAVIS_BUILD_DIR/coverals --base-directory ./ --capture --output-file $TRAVIS_BUILD_DIR/coverals/coverage.info - - # ... erasing /test/ /example/ folder data - - cd $BOOST - - $LCOV --remove $TRAVIS_BUILD_DIR/coverals/coverage.info "/usr*" "*/$PROJECT_TO_TEST/test/*" $IGNORE_COVERAGE "*/$PROJECT_TO_TEST/tests/*" "*/$PROJECT_TO_TEST/examples/*" "*/$PROJECT_TO_TEST/example/*" -o $TRAVIS_BUILD_DIR/coverals/coverage.info - - # ... erasing data that is not related to this project directly - - OTHER_LIBS=`grep "submodule .*" .gitmodules | sed 's/\[submodule\ "\(.*\)"\]/"\*\/boost\/\1\.hpp" "\*\/boost\/\1\/\*"/g'| sed "/\"\*\/boost\/$PROJECT_TO_TEST\/\*\"/d" | sed ':a;N;$!ba;s/\n/ /g'` - - echo $OTHER_LIBS - - eval "$LCOV --remove $TRAVIS_BUILD_DIR/coverals/coverage.info $OTHER_LIBS -o $TRAVIS_BUILD_DIR/coverals/coverage.info" - - # Sending data to Coveralls - - cd $TRAVIS_BUILD_DIR - - gem install coveralls-lcov - - coveralls-lcov coverals/coverage.info diff --git a/deps/boost-process/README.md b/deps/boost-process/README.md deleted file mode 100644 index a55bc32..0000000 --- a/deps/boost-process/README.md +++ /dev/null @@ -1,24 +0,0 @@ -#[Boost Process (Boost.Process)](https://github.com/klemens-morgenstern/boost-process) - -Boost.process is not yet part of the [Boost C++ Libraries](http://github.com/boostorg), but will probably be released in boost 1.64. It is a library for comfortable management of processes. - -### Test results - -Branches | Build | Tests coverage | -----------------|-------------- | -------------- | -Develop: | [![Build Status](https://travis-ci.org/klemens-morgenstern/boost-process.svg?branch=develop)](https://travis-ci.org/klemens-morgenstern/boost-process) [![Build status](https://ci.appveyor.com/api/projects/status/peup7e6m0e1bb5ba?svg=true)](https://ci.appveyor.com/project/klemens-morgenstern/boost-process) | [![Coverage Status](https://coveralls.io/repos/github/klemens-morgenstern/boost-process/badge.svg?branch=develop)](https://coveralls.io/github/klemens-morgenstern/boost-process?branch=develop) | -Master: | [![Build Status](https://travis-ci.org/klemens-morgenstern/boost-process.svg?branch=master)] (https://travis-ci.org/klemens-morgenstern/boost-process) [![Build status](https://ci.appveyor.com/api/projects/status/peup7e6m0e1bb5ba/branch/master?svg=true)](https://ci.appveyor.com/project/klemens-morgenstern/boost-process/branch/master) | [![Coverage Status](https://coveralls.io/repos/github/klemens-morgenstern/boost-process/badge.svg?branch=master)](https://coveralls.io/github/klemens-morgenstern/boost-process?branch=master) | - -[Open Issues](https://github.com/klemens-morgenstern/boost-process/issues) - -[Latest developer documentation](http://klemens-morgenstern.github.io/process/) - -### About -This C++11 library is the current result of a long attempt to get a boost.process library, which is going on since 2006. - -### License -Distributed under the [Boost Software License, Version 1.0](http://www.boost.org/LICENSE_1_0.txt). - -### Dependency - -This library requires boost 1.63. Since this is not released yet you can clone the winapi module from [here](https://github.com/boostorg/winapi) to get it to work on windows. diff --git a/deps/boost-process/doc/Jamfile.jam b/deps/boost-process/doc/Jamfile.jam deleted file mode 100644 index e361b45..0000000 --- a/deps/boost-process/doc/Jamfile.jam +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright (c) 2006, 2007 Julio M. Merino Vidal -# Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -# Copyright (c) 2009 Boris Schaeling -# Copyright (c) 2010 Felipe Tanus, Boris Schaeling -# Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -# -# Distributed under the Boost Software License, Version 1.0. (See accompanying -# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -using boostbook ; -using quickbook ; -using doxygen ; - - -local images = [ glob images/*.svg ] ; -install images : $(images) : html/boost_process ; -install images_glob : $(images) : $(BOOST_ROOT)/doc/html/boost_process ; - -import type ; -type.register XMLPROCESSWORKAROUND : : XML ; -import generators ; -generators.register-standard common.copy : XML : XMLPROCESSWORKAROUND ; - -xmlprocessworkaround posix_pseudocode : posix_pseudocode.xml ; -xmlprocessworkaround windows_pseudocode : windows_pseudocode.xml ; - - -doxygen autodoc -: - ../../../boost/process.hpp - [ glob ../../../boost/process/*.hpp ] -: - EXCLUDE_SYMBOLS=BOOST_ASIO_INITFN_RESULT_TYPE - PREDEFINED=BOOST_PROCESS_DOXYGEN - HIDE_UNDOC_CLASSES=YES - HIDE_UNDOC_MEMBERS=YES - EXAMPLE_PATH=. - posix_pseudocode - windows_pseudocode - . -; - - - -boostbook standalone -: - process.qbk -: - autodoc - images - images_glob - boost.root=../../../.. - html.stylesheet=../../../../doc/src/boostbook.css -; - -############################################################################### -alias boostdoc - : standalone/docbook - : - : images_glob - : ; -explicit boostdoc ; -alias boostrelease ; -explicit boostrelease ; \ No newline at end of file diff --git a/deps/boost-process/doc/acknowledgements.qbk b/deps/boost-process/doc/acknowledgements.qbk deleted file mode 100644 index 4442512..0000000 --- a/deps/boost-process/doc/acknowledgements.qbk +++ /dev/null @@ -1,11 +0,0 @@ -[section Acknowledgements] - -The first Boost.Process draft was created in 2006. A lof of people have worked on various drafts since then. Especially Merino Vidal, Ilya Sokolov and Felipe Tanus spent a lot of time working on early drafts. They influenced Boost.Process over the years and wrote code which, to various extents, is still around in the library today. - -The design of earlier versions of Boost.Process was not always satisfying. In 2011 Jeff Flinn proposed the executor and initializer concepts Boost.Process is based on today. Without Jeff's idea the overall design of Boost.Process would not look like it does today. - -A special thank you goes to [@http://www.intra2net.com/ Intra2net AG] (especially Thomas Jarosch) who sponsored a project to support the development of Boost.Process. It was this sponsorship which made it possible to create a new Boost.Process version in 2012. - -Great thanks also goes to Boris Schaeling, who despite having boost.process rejected, went on to work on it and maintained it up until this day and participated in the development of the current version. - -[endsect] diff --git a/deps/boost-process/doc/concepts.qbk b/deps/boost-process/doc/concepts.qbk deleted file mode 100644 index e170898..0000000 --- a/deps/boost-process/doc/concepts.qbk +++ /dev/null @@ -1,82 +0,0 @@ -[section:concepts Concepts] -In this section, some of the underlying concepts of the operating system used in this library, will be explained. -In the following chapters we will presume knowledge of that. Though please note, -that this is a short summary and not conclusive of everything that can be done. - -The goal of this library is to implement a portable wrapper, so that we will explain mostly what -windows and posix have in common. - -[section:pipes Pipes] -Pipes are a facility for communication between different threads, processes and in some cases machines, the operating system provides. - -The typical feature of a pipe is, that it is one channel, to which two handles are given, one for reading (source), one for writing (sink). -In that it is different than other facilities (like sockets) and provides another way to manage the connectivity: if one side of the pipe is closed -(i.e. the pipe is broken), the other is notified. - -Pipes are typically used for interprocess communication. The main reason is, that pipes can be directly assigned to the process stdio, i.e. stderr, stdin and stdout. -Additionally, half of the pipe can be inherited to the child process and closed in the father process. This will cause the pipe to be broken when the child process exits. - -Though please not, that if the the same thread reads and write to a pipe, it will only talk to itself. - -[section:anonymous Anonymous Pipes] - -The usual type of pipes, are the anonymous ones. Since the have no name, -a handle to them can only be obtained from duplicating either handle. - -In this library the following functions are used for the creation of unnamed pipes: - -* [@http://pubs.opengroup.org/onlinepubs/7908799/xsh/pipe.html posix] -* [@https://msdn.microsoft.com/de-de/library/windows/desktop/aa365152.aspx windows] - -[endsect] - -[section:named Named Pipes] - -As the name suggests, named pipes have a string identifier. This means that a -handle to them can be obtained with the identifier, too. - -The implementation on posix uses [@(http://pubs.opengroup.org/onlinepubs/009695399/functions/mkfifo.html fifos], -which means, that the named pipe behaves like a file. - -Windows does provide a facility called [@https://msdn.microsoft.com/en-us/library/windows/desktop/aa365150(v=vs.85).aspx named pipes], -which also have file-like names, but are in a different scope than the actual file system. - -[note The main reason named pipes are part of this library, is because they need to be internally used for asynchrounous communication on windows.] - -[endsect] - -[endsect] - - -[section:process Processes] - -A process is an independently executable entity, which is different from a thread, in that it has it's own resources. -Those include memory and hardware resources. - -Every process is identified by a unique number[footnote it is unique as long as the process is active], called the process identification digit, `pid`. - -[section:exit_code Exit code] -A process will return an integer value indicating whether it was successful. On posix -there are more codes associated with that, but not so on windows. Therefore there is not such encoding currently in the library. -However an exit code of zero means the process was successful, while one different than zero indicates an error. -[endsect] - -[section:termination Termination] -Processes can also be forced to exit. There are two ways to do this, signal the process to so and wait, and just terminate the process without conditions. - -Usually the first approach is to signal an exit request, but windows - unlike posix - does not provide a consistent way to do this. Hence this is not part of the -library and only the hard terminate is. - -[endsect] - -[endsect] - -[section:env Environment] - -The environment is a map of variables local to every process. The most significant one for this library - is the `PATH` variable, which contains a list of paths, that ought to be searched for executables. A shell will do this automatically, - while this library provides a function for that. - -[endsect] - -[endsect] \ No newline at end of file diff --git a/deps/boost-process/doc/design.qbk b/deps/boost-process/doc/design.qbk deleted file mode 100644 index 1d1161b..0000000 --- a/deps/boost-process/doc/design.qbk +++ /dev/null @@ -1,94 +0,0 @@ -[section:design Design Rationale] -[section Scope] -This library is meant to give an wrapper around the different OS-specific methods -to launch processes. Its aim is to provide all functionality that is available on -those systems and allow the user to do all related things, which require using the OS APIs. - -[*This library does not try to provide a full library for everything process related] -In many discussions the proposal was made to build boost.process into a DSEL [footnote Domain Specific Embedded Language] of some sort. -This is not the goal, it rather provides the facilities to build such a DSEL-Library on top of it. -Therefore the library also does [*not] force any particular use (such as only asynchronous communication) on its user. -It rather could be integrated with such a library. - -[endsect] -[section Interface Style] - -Boost.Process does use a very particular style when constructing a process. -This is because a process holds many properties, which are not members of the actual child class. -Those properties are in many cases not accessible by the father process, for example when using environments. -Here the child process can modify its own environment, but there is no way for the father process to know. -That means, that a child process has properties that cannot be accessed in C++. - -This now leads to the two styles supported and mixed by this library. Overloading and properties. -Consider that you may want to launch a process passing a number of arguments. This is supported in both styles, and would look like this: - -``` -system("gcc", "--version"); //overloading -system("gcc", args={"--version"}); //property style. -``` - -Both styles can also be mixed in some cases. - -``` -system("gcc", "-c", args+={"main.cpp"}); -``` - -In the following section the avaible styles will be described. Note that the -overload style is implemented via type traits, so the types will be listed. - -[caution There is no guarantee in which order the arguments will be applied! -There is however a guarantee for arguments belonging together, i.e. the string -argument and the args property will be evaluated in the order given.] - -[endsect] -[section:arg_cmd_style Arguments/Command Style] - -When passing arguments to the process, two styles are provided, the cmd-style and the exe-/args-style. - -The cmd style will interpret the string as a sequence of the exe and arguments and parse them as such, while the exe-/args-style will -interpret each string as an argument. - -[table:id Cmd vs Exe/Args - [[String] [Cmd] [Exe/Args]] - [["gcc --version"] [{"gcc", "--version"}] [{"\\"gcc --version\\""}]] -] - -When using the overloading variant, a single string will result in a cmd interpretation, -several strings will yield a exe-args interpretation. Both version can be set explicitly: - -``` -system("grep -c false /etc/passwd"); //cmd style -system("grep", "-c", "false", "/etc/passwd"); //exe-/args- - -system(cmd="grep -c false /etc/passwd"); //cmd style -system(exe="grep", args={"-c", "false", "/etc/passwd"}); //exe-/args- -``` - -[note If a '"' sign is used in the argument style, it will be passed as part of the argument. -If the same effect it wanted with the cmd syntax, it ought to be escaped, i.e. '\\\"'. ] -[note The `PATH` variable will automatically be searched in the command style, -but the one of the launching process, not the one passed to the child process.] -[endsect] - -[section:plat_ext Extensions] - -The simplest form to extend functionality is to provide another handler, which -will be called on the respective events on process launching. The names are: - -*`boost::process::on_setup` -*`boost::process::on_error` -*`boost::process::on_success` - - -As an example: - -``` -child c("ls", on_setup([](){cout << "On Setup" << endl;}); -``` - - -[note On posix all those callbacks will be handled by this process, not the created one. -This is different for the posix extensions, which can be executed on the forked process.] -[endsect] - -[endsect] diff --git a/deps/boost-process/doc/extend.qbk b/deps/boost-process/doc/extend.qbk deleted file mode 100644 index 3f108f0..0000000 --- a/deps/boost-process/doc/extend.qbk +++ /dev/null @@ -1,211 +0,0 @@ -[def __on_exit__ [globalref boost::process::on_exit on_exit]] -[def __on_success__ [globalref boost::process::extend::on_success ex::on_success]] -[def __child__ [classref boost::process::child child]] -[def __handler__ [classref boost::process::extend::handler handler]] -[def __on_success__ [memberref boost::process::extend::handler::on_success on_success]] -[def __posix_executor__ [classref boost::process::extend::posix_executor ex::posix_executor]] -[def __windows_executor__ [classref boost::process::extend::windows_executor ex::windows_executor]] -[def io_service [@http://www.boost.org/doc/libs/release/doc/html/boost_asio/reference/io_service.html boost::asio::io_service]] -[def __require_io_service__ [classref boost::process::extend::require_io_service ex::require_io_service]] -[def __async_handler__ [classref boost::process::extend::async_handler ex::async_handler]] -[def __get_io_service__ [funcref boost::process::extend::get_io_service ex::get_io_service]] - -[section:extend Extensions] -To extend the library, the header [headerref boost/process/extend.hpp extend] is provided. - -It only provides the explicit style for custom properties, but no implicit style. - -What this means is, that a custom initializer can be implemented, a reference to which can be passed to one of the launching functions. -If a class inherits [classref boost::process::extend::handler] it will be regarded as a initializer and thus directly put into the sequence -the executor gets passed. - -[section:structure Structure] - -The executor calls different handlers of the initializers during the process launch. -The basic structure is consists of three functions, as given below: - -* [globalref boost::process::extend::on_setup on_setup] -* [globalref boost::process::extend::on_error on_error] -* [globalref boost::process::extend::on_success on_success] - -''' - -''' - -Additionally posix provides three more handlers, listed below: - -* [globalref boost::process::extend::on_fork_error on_fork_error] -* [globalref boost::process::extend::on_exec_setup on_exec_setup] -* [globalref boost::process::extend::on_exec_error on_exec_error] - -For more information see the reference of [classref boost::process::extend::posix_executor posix_executor]. - -[endsect] -[section:simple Simple extensions] - -The simplest extension just takes a single handler, which can be done in a functional style. -So let's start with a simple hello-world example, while we use a C++14 generic lambda. - -``` -using namespace boost::process; -namespace ex = bp::extend; - -__child__ c("foo", ex::__on_success__=[](auto & exec) {std::cout << "hello world" << std::endl;}); -``` - -Considering that lambda can also capture values, data can easily be shared between handlers. - -To see which members the executor has, refer to [classref boost::process::extend::windows_executor windows_executor] -and [classref boost::process::extend::posix_executor posix_executor]. - -[note Combined with __on_exit__ this can also handle the process exit.] - -[caution The posix handler symbols are not defined on windows.] - -[endsect] - -[section:handler Handler Types] - -Since the previous example is in a functional style, it is not very reusable. -To solve that problem, the [classref boost::process::extend::handler handler] has an alias in the `boost::process::extend` namespace, to be inherited. -So let's implement the hello world example in a class. - -``` -struct hello_world : __handler__ -{ - template - void __on_success__(Executor & exec) const - { - std::cout << "hello world" << std::endl; - } -}; - -//in our function -__child__ c("foo", hello_world()); -``` - -[note The implementation is done via overloading, not overriding.] - -Every handler not implemented dafaults to [classref boost::process::extend::handler handler], where an empty handler is defined for each event. - -[endsect] - - - -[section:async Asynchronous Functionality] - -Since `boost.process` provides an interface for [@http://www.boost.org/doc/libs/release/libs/asio/ boost.asio], -this functionality is also available for extensions. If the class needs the io_service for some reason, the following code will do that. - -``` -struct async_foo : __handler__, __require_io_service__ -{ - tempalte - void on_setup(Executor & exec) - { - __io_service__ & ios = __get_io_service__(exec.seq); //gives us a reference and a compiler error if not present. - //do something with ios - } -}; -``` - -[note Inheriting [globalref boost::process::extend::require_io_service require_io_service] is necessary, so [funcref boost::process::system system] provides one.] - -Additionally the handler can provide a function that is invoked when the child process exits. This is done through __async_handler__. - -[note [globalref boost::process::extend::async_handler async_handler] implies [globalref boost::process::extend::require_io_service require_io_service] .] - -``` -struct async_bar : __handler, __async_handler__ -{ - template - std::function on_exit_handler(Executor & exec) - { - auto handler = this->handler; - return [handler](int exit_code, const std::error_code & ec) - { - std::cout << "hello world, I exited with " << exit_code << std::endl; - }; - - } -}; -``` - - -[caution `on_exit_handler` does not default and is always required when [classref boost::process::extend::async_handler async_handler] is inherited. ] - -[endsect] - -[section:error Error handling] - -If an error occurs in the initializers it shall be told to the executor and not handles directly. This is because -the behaviour can be changed through arguments passed to the launching function. Hence the the executor -has the function `set_error`, which takes an [@http://en.cppreference.com/w/cpp/error/error_code std::error_code] and a string. -Depending on the cofiguration of the executor, this may either throw, set an internal `error_code`, or do nothing. - -So let's take a simple example, where we set a randomly chosen `error_code`. - -``` -auto set_error = [](auto & exec) - { - std::error_code ec{42, std::system_category()}; - exec.set_error(ec, "a fake error"); - - }; -__child__ c("foo", on_setup=set_error); -``` - -Since we do not specify the error-handling mode in this example, this will throw [classref boost::process::process_error process_error]. - -[endsect] - -[section:exec_over Executor Overloading] - -Now that we have a custom initializer, let's consider how we can handle differences between different executors. -The distinction is between posix and windows and `char` and `wchar_t` on windows. -One solution is to use the [@http://www.boost.org/doc/libs/master/boost/system/api_config.hpp BOOST_WINDOWS_API and BOOST_POSIX_API] macros, -which are automatically available as soon as any process-header is included. - -Another variant are the type aliases __posix_executor__ and __windows_executor__, where the executor, not on the current system is a forward-declaration. -This works fine, because the function will never get invoked. So let's implement another example, which prints the executable name __on_success__. - -``` -struct hello_exe : __handler__ -{ - template - void __on_success__(__posix_executor__ & exec) - { - std::cout << "posix-exe: " << exec.exe << std::endl; - } - - template - void __on_success__(__windows_executor__ & exec) - { - //note: exe might be a nullptr on windows. - if (exec.exe != nullptr) - std::cout << "windows-exe: " << exec.exe << std::endl; - else - std::cout << "windows didn't use exe" << std::endl; - } - - template - void __on_success__(__windows_executor__ & exec) - { - //note: exe might be a nullptr on windows. - if (exec.exe != nullptr) - std::wcout << L"windows-exe: " << exec.exe << std::endl; - else - std::cout << "windows didn't use exe" << std::endl; - } - -}; -``` - -So given our example, the definitions with the non-native exectur are still a template so that they will not be evaluated if not used. Hence this provides a -way to implement systems-specific code without using the preprocessor. - -[note If you only write a partial implementation, e.g. only for __posix_executor__, the other variants will default to __handler__]. - -[endsect] - -[endsect] \ No newline at end of file diff --git a/deps/boost-process/doc/faq.qbk b/deps/boost-process/doc/faq.qbk deleted file mode 100644 index 2d9d762..0000000 --- a/deps/boost-process/doc/faq.qbk +++ /dev/null @@ -1,87 +0,0 @@ -[section:faq Frequently Asked Questions] - -[section:dead_lock Why does this produce a deadlock?] - -Now let's revisit our c++filt example and we will put in an obvious mistake. -This might however be not as obvious for more complex applications. - -``` -vector demangle(vector in) -{ - - ipstream is; - opstream os; - child c("c++filt", std_out > is, std_in < os); - - vector data; - for (auto & elem : data) - { - string line; - getline(is, line); - os << elem; - } -} - -``` -We switched the read and write operation up, so that's causing a dead-lock. -This locks immediately. This is because `c++filt` expects input, before -outputting any data. The launching process on the other hand wait's for it's output. - -[endsect] - -[section:closep Why does the pipe not close?] - -Now for another example, which might look correct, let's consider you want -to use `ls` to read the current directory. - -``` -ipstream is; -child c("ls", std_out > is); - -std::string file; -while (is >> file) - cout << "File: " << file << endl; - -``` - -This will also deadlock, because the pipe does not close when the subprocess exits. -So the `ipstream` will still look for data even though the process has ended. - -[note It is not possible to use automatically pipe-closing in this library, because -a pipe might be a file-handle (as for async pipes on windows).] - -But, since pipes are buffered, you might get incomplete data if you do this: - -``` -ipstream is; -child c("ls", std_out > is); - -std::string file; -while (c.running()) -{ - is >> file; - cout << "File: " << file << endl; -} -``` - -It is therefore highly recommended that you use the asynchronous api if you are -not absolutely sure how the output will look. - -[endsect] - -[section:wchar_t When will the codecvt be used?] - -Since windows does not use UTF-8 it is sometimes unavoidable to use the `wchar_t` version of the WinApi. -To keep this library consistent it provides `wchar_t` support on posix also. - -Since the posix api is purely `char` every `wchar_t` based type will be converted into `char`. - -Windows on the other hand is more selective; the default is to use `char`, -but if any parameter requires `wchar_t`, everything will be converted to `wchar_t`. -This also includes `boost::filesystem::path`. Additionally, if the system does not provide -the `char` api (as is the case with Windows CE) everything will also be converted. - - -[endsect] - -[endsect] \ No newline at end of file diff --git a/deps/boost-process/doc/images/plantuml.txt b/deps/boost-process/doc/images/plantuml.txt deleted file mode 100644 index b8a7cdb..0000000 --- a/deps/boost-process/doc/images/plantuml.txt +++ /dev/null @@ -1,118 +0,0 @@ -Plantuml source file (for later edit) -// Style - -skinparam backgroundColor #FFFFFF - -skinparam sequence { - ActorBorderColor DeepSkyBlue - ArrowColor #4a6484 - - LifeLineBorderColor #4a6484 - ParticipantBackgroundColor #91c6ff - ParticipantBorderColor black - BoxBorderColor black -} - - -//posix no error -/** -\plantuml -activate Father - -box "Child Process" #LightGrey - participant Child - participant Exe -end box - -Father->Father : on_setup -activate Father -deactivate Father -Father->Child : fork -activate Child -Father -> Father : wait for error -deactivate Father - - -Child->Child : on_exec_setup -activate Child -deactivate Child -Child->Exe : execve -deactivate Child -activate Father -activate Exe - -Father -> Father : on_success -activate Father -deactivate Father - -\endplantuml */ - -//posix exec error -/** -\plantuml -activate Father - -Father->Father : on_setup -activate Father -deactivate Father -Father->Child : fork -activate Child -Father -> Father : wait for error -deactivate Father - -Child->Child : on_exec_setup -activate Child -deactivate Child -Child->Child : execve -Child->Child : on_exec_error -activate Child -deactivate Child -Child->Father : report -deactivate Child -activate Father -Father -> Father : on_error -activate Father -deactivate Father -\endplantuml - -//posix fork error -\plantuml -activate Father - -Father->Father : on_setup -activate Father -deactivate Father -Father->Father : fork -Father -> Father : on_fork_error -activate Father -deactivate Father -Father -> Father : on_error -activate Father -deactivate Father -\endplantuml - - -//windows. -\plantuml -activate Father - -Father->Father : on_setup -activate Father -deactivate Father -Father->Child : CreateProcess -activate Child - -alt Successful Launch - -Father -> Father : on_success -activate Father -deactivate Father - -else Error during launch - -Father -> Father : on_error -activate Father -deactivate Father - -end -\endplantuml diff --git a/deps/boost-process/doc/images/posix_exec_err.svg b/deps/boost-process/doc/images/posix_exec_err.svg deleted file mode 100644 index 134b36b..0000000 --- a/deps/boost-process/doc/images/posix_exec_err.svg +++ /dev/null @@ -1 +0,0 @@ -FatherFatherChildChildon_setupforkwait for erroron_exec_setupexecveon_exec_errorreporton_error \ No newline at end of file diff --git a/deps/boost-process/doc/images/posix_fork_err.svg b/deps/boost-process/doc/images/posix_fork_err.svg deleted file mode 100644 index f335cd7..0000000 --- a/deps/boost-process/doc/images/posix_fork_err.svg +++ /dev/null @@ -1 +0,0 @@ -FatherFatheron_setupforkon_fork_erroron_error \ No newline at end of file diff --git a/deps/boost-process/doc/images/posix_success.svg b/deps/boost-process/doc/images/posix_success.svg deleted file mode 100644 index a24188d..0000000 --- a/deps/boost-process/doc/images/posix_success.svg +++ /dev/null @@ -1 +0,0 @@ -Child ProcessFatherFatherChildChildExeExeon_setupforkwait for erroron_exec_setupexecveon_success \ No newline at end of file diff --git a/deps/boost-process/doc/images/windows_exec.svg b/deps/boost-process/doc/images/windows_exec.svg deleted file mode 100644 index a5f8482..0000000 --- a/deps/boost-process/doc/images/windows_exec.svg +++ /dev/null @@ -1 +0,0 @@ -FatherFatherChildChildon_setupCreateProcessalt[Successful Launch]on_success[Error during launch]on_error \ No newline at end of file diff --git a/deps/boost-process/doc/introduction.qbk b/deps/boost-process/doc/introduction.qbk deleted file mode 100644 index 060a781..0000000 --- a/deps/boost-process/doc/introduction.qbk +++ /dev/null @@ -1,24 +0,0 @@ -[section:introduction Introduction] - -Boost.Process is a library to manage system processes. It can be used to: - -* create child processes -* setup streams for child processes -* communicate with child processes through streams (synchronously or asynchronously) -* wait for processes to exit (synchronously or asynchronously) -* terminate processes - -Here's a simple example of how to start a program with Boost.Process: - -[def ipstream [classref boost::process::ipstream ipstream]] -[def system [funcref boost::process::system system]] -[def std_out [globalref boost::process::std_out std_out]] -[def child [globalref boost::process::child child]] -[def boost/process.hpp [headerref boost/process.hpp boost/process.hpp]] -[def std::string [@http://en.cppreference.com/w/cpp/string/basic_string std::string]] -[def std::getline [@http://en.cppreference.com/w/cpp/string/basic_string/getline std::getline]] - -[import ../example/intro.cpp] -[intro] - -[endsect] diff --git a/deps/boost-process/doc/posix_pseudocode.xml b/deps/boost-process/doc/posix_pseudocode.xml deleted file mode 100644 index ef7348d..0000000 --- a/deps/boost-process/doc/posix_pseudocode.xml +++ /dev/null @@ -1,60 +0,0 @@ - - -for (auto & s : seq) - s.on_setup(*this); - -if (error()) -{ - for (auto & s : seq) - s.on_error(*this, error()); - return child(); -} - -pid = fork() -on_setup(*this); - -if (pid == -1) //fork error -{ - set_error(get_last_error()); - for (auto & s : seq) - s.on_fork_error(*this, error()); - for (auto & s : seq) - s.on_error(*this, error()); - return child() -} -else if (pid == 0) //child process -{ - for (auto & s : seq) - s.on_exec_setup(*this); - execve(exe, cmd_line, env); - auto ec = get_last_error(); - for (auto & s : seq) - s.on_exec_error(*this); - - unspecified();//here the error is send to the father process interally - - std::exit(EXIT_FAILURE); - return child(); //for C++ compliance -} - -child c(pid, exit_code); - -unspecified();//here, we read the the error from the child process - -if (error()) - for (auto & s : seq) - s.on_error(*this, error()); -else - for (auto & s : seq) - s.on_success(*this); - -//now we check again, because a on_success handler might've errored. -if (error()) -{ - for (auto & s : seq) - s.on_error(*this, error()); - return child(); -} -else - return c; - \ No newline at end of file diff --git a/deps/boost-process/doc/process.qbk b/deps/boost-process/doc/process.qbk deleted file mode 100644 index d7a158d..0000000 --- a/deps/boost-process/doc/process.qbk +++ /dev/null @@ -1,21 +0,0 @@ -[library Boost.Process - [quickbook 1.5] - [authors [Morgenstern, Klemens David]] - [copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012 Julio M. Merino Vidal, Ilya Sokolov, Felipe Tanus, Jeff Flinn, Boris Schaeling, 2016 Klemens D. Morgenstern] - [id process] - [dirname process] - [license - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or copy at - http://www.boost.org/LICENSE_1_0.txt) - ] -] - -[include introduction.qbk] -[include concepts.qbk] -[include tutorial.qbk] -[include design.qbk] -[include extend.qbk] -[include faq.qbk] -[xinclude autodoc.xml] -[include acknowledgements.qbk] diff --git a/deps/boost-process/doc/tutorial.qbk b/deps/boost-process/doc/tutorial.qbk deleted file mode 100644 index 3fa9b25..0000000 --- a/deps/boost-process/doc/tutorial.qbk +++ /dev/null @@ -1,428 +0,0 @@ -[def bp::system [funcref boost::process::system bp::system]] -[def bp::async_system [funcref boost::process::async_system bp::async_system]] -[def bp::spawn [funcref boost::process::spawn bp::spawn]] -[def bp::child [classref boost::process::child bp::child]] -[def bp::cmd [classref boost::process::cmd bp::cmd]] -[def bp::group [classref boost::process::group bp::group]] -[def bp::ipstream [classref boost::process::ipstream bp::ipstream]] -[def bp::opstream [classref boost::process::opstream bp::opstream]] -[def bp::pstream [classref boost::process::pstream bp::pstream]] -[def bp::pipe [classref boost::process::pipe bp::pipe]] -[def bp::async_pipe [classref boost::process::async_pipe bp::async_pipe]] -[def bp::search_path [funcref boost::process::search_path bp::search_path]] -[def boost_org [@www.boost.org "www.boost.org"]] -[def std::system [@http://en.cppreference.com/w/cpp/utility/program/system std::system]] -[def child_running [memberref boost::process::child::running running]] -[def child_wait [memberref boost::process::child::wait wait]] -[def child_wait_for [memberref boost::process::child::wait_for wait_for]] -[def child_exit_code [memberref boost::process::child::exit_code exit_code]] -[def group_wait_for [memberref boost::process::group::wait_for wait_for]] -[def bp::on_exit [globalref boost::process::on_exit bp::on_exit]] -[def bp::null [globalref boost::process::null bp::null]] -[def child_terminate [memberref boost::process::child::terminate terminate]] -[def group_terminate [memberref boost::process::group::terminate terminate]] -[def group_wait [memberref boost::process::group::wait wait]] -[def bp::std_in [globalref boost::process::std_in bp::std_in]] -[def bp::std_out [globalref boost::process::std_out bp::std_out]] -[def bp::std_err [globalref boost::process::std_err bp::std_err]] -[def io_service [@http://www.boost.org/doc/libs/release/doc/html/boost_asio/reference/io_service.html boost::asio::io_service]] -[def asio_buffer [@http://www.boost.org/doc/libs/release/doc/html/boost_asio/reference/buffer.html boost::asio::buffer]] -[def asio_async_read [@http://www.boost.org/doc/libs/release/doc/html/boost_asio/reference/async_read.html boost::asio::async_read]] -[def bp::environment [classref boost::process::basic_environment bp::environment]] -[def bp::native_environment [classref boost::process::basic_native_environment bp::native_environment]] -[def boost::this_process::environment [funcref boost::this_process::environment boost::this_process::environment]] -[def std::chrono::seconds [@http://en.cppreference.com/w/cpp/chrono/duration std::chrono::seconds]] -[def std::vector [@http://en.cppreference.com/w/cpp/container/vector std::vector]] - -[def __wait_for__ [memberref boost::process::child::wait_for wait_for]] -[def __wait_until__ [memberref boost::process::child::wait_until wait_until]] -[def __detach__ [memberref boost::process::child::detach detach]] - -[def __reference__ [link process.reference reference]] -[def __concepts__ [link boost_process.concepts concepts]] - -[def boost::asio::yield_context [@http://www.boost.org/doc/libs/release/doc/html/boost_asio/reference/yield_context.html boost::asio::yield_context]] -[def boost::asio::coroutine [@http://www.boost.org/doc/libs/release/doc/html/boost_asio/reference/coroutine.html boost::asio::coroutine]] -[def bp::env [globalref boost::process::env bp::env]] - -[section:tutorial Tutorial] - -In this section we will go step by step through the different features of -boost.process. For a full description see the __reference__ and the __concepts__ sections. - -[section Starting a process] - -We want to start a process, so let's start with a simple process. We will -invoke the gcc compiler to compile a simple program. - -With the standard library this looks like this. - -``` -int result = std::system("g++ main.cpp"); -``` - -Which we can write exactly like this in boost.process. - -``` -namespace bp = boost::process; //we will assume this for all further examples -int result = bp::system("g++ main.cpp"); -``` - -If a single string (or the explicit form bp::cmd), it will be interpreted as a command line. -That will cause the execution function to search the `PATH` variable to find the executable. -The alternative is the `exe-args` style, where the first string will be interpreted as a filename (including the path), -and the rest as arguments passed to said function. - -[note For more details on the `cmd`/`exe-args` style look [link boost_process.design.arg_cmd_style here]] - -So as a first step, we'll use the `exe-args` style. - -``` -int result = bp::system("/usr/bin/g++", "main.cpp"); -``` - -With that sytax we still have "g++" hard-coded, so let's assume we get the string -from an external source as `boost::filesystem::path`, we can do this too. - -``` -boost::filesystem::path p = "/usr/bin/g++"; //or get it from somewhere else. -int result = bp::system(p, "main.cpp"); -``` - -Now we might want to find the `g++` executable in the `PATH`-variable, as the `cmd` syntax would do. -`Boost.process` provides a function to this end: bp::search_path. - -``` -boost::filesystem::path p = bp::search_path("g++"); //or get it from somewhere else. -int result = bp::system(p, "main.cpp"); -``` - -[note [funcref boost::process::search_path search_path] will search for any executable with that name. -This also includes to add a file suffix on windows, such as `.exe` or `.bat`.] - -[endsect] - -[section:launch_mode Launch functions] - -Given that in our example used the [funcref boost::process::system system] function, -our program will wait until the child process is completed. This maybe unwanted, -especially since compiling can take a while. - -In order to avoid that, boost.process provides several ways to launch a process. -Besides the already mentioned [funcref boost::process::system system] function and it's -asynchronous version [funcref boost::process::async_system async_system], -we can also use the [funcref boost::process::spawn spawn] function or the -[classref boost::process::child child] class. - -The [funcref boost::process::spawn spawn] function launches a process and -immediately detaches it, so no handle will be returned and the process will be ignored. -This is not what we need for compiling, but maybe we want to entertain the user, -while compiling: - -``` -bp::spawn(bp::search_path("chrome"), boost_org); -``` - -Now for the more sensible approach for compiling: a non-blocking execution. -To implement that, we directly call the constructor of [classref boost::process::child child]. - -``` -bp::child c(bp::search_path("g++"), "main.cpp"); - -while (c.child_running()) - do_some_stuff(); - -c.child_wait(); //wait for the process to exit -int result = c.child_exit_code(); -``` - -So we launch the process, by calling the child constructor. Then we check and do other -things while the process is running and afterwards get the exit code. The call -to child_wait is necessary, to obtain it and tell the operating system, that no -one is waiting for the process anymore. - -[note You can also wait for a time span or a until a time point with __wait_for__ and __wait_until__] - -[warning If you don't call wait on a child object, it will be terminated on destruction. -This can be avoided by calling __detach__ beforehand] - -[endsect] -[section:error_handling Error] - -Until now, we have assumed that everything works out, but it is not impossible, -that "g++" is not present. That will cause the launch of the process to fail. -The default behaviour of all functions is to throw an -[@http://en.cppreference.com/w/cpp/error/system_error std::system_error] on failure. -As with many other functions in this library, passing an [@http://en.cppreference.com/w/cpp/error/error_code std::error_code] -will change the behaviour, so that instead of throwing an exception, the error will be a assigned to the error code. - -``` -std::error_code ec; -bp::system c("g++ main.cpp", ec); -``` -[endsect] -[section:io Synchronous I/O] - -In the examples given above, we have only started a program, but did not consider the output. -The default depends on the system, but usually this will just write it to the same output as the launching process. -If this shall be guaranteed, the streams can be explicitly forwarded like this. - -``` - bp::system("g++ main.cpp", bp::std_out > stdout, bp::std_err > stderr, bp::std_in < stdin); -``` - -Now for the first example, we might want to just ignore the output, which can be done by redirecting it to the null-device. -This can be achieved this way: - -``` -bp::system("g++ main.cpp", bp::std_out > bp::null); -``` - -Alternatively we can also easily redirect the output to a file: - -``` -bp::system("g++ main.cpp", bp::std_out > "gcc_out.log"); -``` - -Now, let's take a more visual example for reading data. -[@http://pubs.opengroup.org/onlinepubs/009696699/utilities/nm.html nm] is a tool on posix, -which reads the outline, i.e. a list of all entry points, of a binary. -Every entry point will be put into a single line, and we will use a pipe to read it. -At the end an empty line is appended, which we use as the indication to stop reading. -Boost.process provides the pipestream ([classref boost::process::ipstream ipstream], -[classref boost::process::opstream opstream], [classref boost::process::pstream pstream]) to -wrap around the [classref boost::process::pipe pipe] and provide an implementation of the -[@http://en.cppreference.com/w/cpp/io/basic_istream std::istream], -[@http://en.cppreference.com/w/cpp/io/basic_ostream std::ostream] and -[@http://en.cppreference.com/w/cpp/io/basic_iostream std::iostream] interface. - -``` -std::vector read_outline(std::string & file) -{ - bp::ipstream is; //reading pipe-stream - bp::child c(bp::search_patk("nm"), file, bp::std_out > is); - - std::vector data; - std::string line; - - while (c.child_running() && std::getline(is, line) && !line.empty()) - data.push_back(line); - - c.child_wait(); - - return data; -} -``` - -What this does is redirect the `stdout` of the process into a pipe and we read this -synchronously. - -[warning The pipe will cause a deadlock if you try to read after nm exited] -[note You can do the same thing with [globalref boost::process::std_err std_err]] - -Now we get the name from `nm` and we might want to demangle it, so we use input and output. -`nm` has a demangle option, but for the sake of the example, we'll use -[@https://sourceware.org/binutils/docs/binutils/c_002b_002bfilt.html c++filt] for this. - -``` -bp::opstream in; -bp::ipstream out; - -bp::child c("c++filt", std_out > out, std_in < in); - -in << "_ZN5boost7process8tutorialE" << endl; -std::string value; -out >> value; - -c.child_terminate(); -``` - -Now you might want to forward output from one process to another processes input. - -``` -std::vector read_demangled_outline(const std::string & file) -{ - bp::pipe p; - bp::ipstream is; - - std::vector outline; - - //we just use the same pipe, so the - bp::child nm(bp::search_path("nm"), file, bp::std_out > p); - bp::child filt(bp::search_path("c++filt"), bp::std_in < p, bp::std_out > is); - - std::string line; - while (filt.running() && std::getline(is, line)) //when nm finished the pipe closes and c++filt exits - outline.push_back(line); - - nm.child_wait(); - filt.wait(); -} - -``` - -This forwards the data from `nm` to `c++filt` without your process needing to do anything. - -[endsect] -[section:async_io Asynchronous I/O] - -Boost.process allows the usage of boost.asio to implement asynchronous I/O. -If you are familiar with [@http://www.boost.org/doc/libs/release/libs/asio/ boost.asio] (which we highly recommend), -you can use [classref boost::process::async_pipe async_pipe] which is implemented -as an I/O-Object and can be used like [classref boost::process::pipe pipe] as shown above. - -Now we get back to our compiling example. `nm` we might analyze it line by line, -but the compiler output will just be put into one large buffer. - -With [@http://www.boost.org/doc/libs/release/libs/asio/ boost.asio] this is what it looks like. - -``` -io_service ios; -std::vector buf; - -bp::async_pipe ap(ios); - -bp::child c(bp::search_path("g++"), "main.cpp", bp::std_out > ap); - -asio_async_read(ap, asio_buffer(buf), - [](const boost::system::error_code &ec, std::size_t size){}); - -ios.run(); -c.wait(); -int result = c.exit_code(); -``` - -To make it easier, boost.process provides simpler interface for that, so that the buffer can be passed directly, -provided we also pass a reference to an io_service. - -``` -io_service ios; -std::vector buf; - -bp::child c(bp::search_path("g++"), "main.cpp", bp::std_out > asio_buffer(buf), ios); - -ios.run(); -c.wait(); -int result = c.exit_code(); -``` - -[note Passing an instance of io_service to the launching function automatically cause it to wait asynchronously for the exit, so no call of -[memberref boost::process::child::wait wait] is needed] - -To make it even easier, you can use [@http://en.cppreference.com/w/cpp/thread/future std::future] for asynchronous operations -(you will still need to pass a reference to a io_service) to the launching function, unless you use bp::system or bp::async_system. - -Now we will revisit our first example and read the compiler output asynchronously: - -``` -boost::asio::io_service ios; - -std::future data; - -child c("g++", "main.cpp", //set the input - bp::std_in.close(), - bp::std_out > bp::null, //so it can be written without anything - bp::std_err > data, - ios); - - -ios.run(); //this will actually block until the compiler is finished - -auto err = data.get(); -``` - -[endsect] -[section:group Groups] - -When launching several processes, processes can be grouped together. -This will also apply for a child process, that launches other processes, -if they do not modify the group membership. E.g. if you call `make` which -launches other processes and call terminate on it, -it will not terminate all the child processes of the child unless you use a group. - -The two main reasons to use groups are: - -# Being able two terminate child processes of the child process -# Grouping several processes into one, just so they can be terminated at once - -If we have program like `make`, which does launch it's own child processes, -a call of child_terminate might not suffice. I.e. if we have a makefile launching `gcc` -and use the following code, the `gcc` process will still run afterwards: - -``` -bp::child c("make"); -if (!c.child_wait_for(std::chrono::seconds(10)) //give it 10 seconds - c.child_terminate(); //then terminate -``` - -So in order to also terminate `gcc` we can use a group. - -``` -bp::group g; -bp::child c("make", g); -if (!g.group_wait_for(std::chrono::seconds(10)) - g.group_terminate(); - -c.child_wait(); //to avoid a zombie process & get the exit code -``` - -Now given the example, we still call child_wait to avoid a zombie process. -An easier solution for that might be to use [funcref boost::process::spawn spawn]. - - -To put two processes into one group, the following code suffices. Spawn already -launches a detached process (i.e. without a child-handle), but they can be grouped, -to that in the case of a problem, RAII is still a given. - -``` -void f() -{ - bp::group g; - bp::spawn("foo", g); - bp::spawn("bar", g); - - do_something(); - - g.group_wait(); -}; -``` - -In the example, it will wait for both processes at the end of the function unless -an exception occures. I.e. if an exception is thrown, the group will be terminated. - - -Please see the [headerref boost/process/group.hpp reference] for more information. - -[endsect] -[section:env Environment] - -This library provides access to the environment of the current process and allows -setting it for the child process. - -``` -//get a handle to the current environment -auto env = boost::this_process::environment(); -//add a variable to the current environment -env["VALUE_1"] = "foo"; - -//copy it into a environment seperate to the one of this process -bp::environment env_ = env; -//append two values to a variable in the new env -env_["VALUE_2"] += {"bar1", "bar2"}; - -//launch a process with `env_` -bp::system("stuff", env_); -``` - -A more convenient way to modify the environment for the child is the -[globalref boost::process::env env] property, which the example as following: - -``` -bp::system("stuff", bp::env["VALUE_1"]="foo", bp::env["VALUE_2"]+={"bar1", "bar2"}); - -``` - -Please see to the [headerref boost/process/environment.hpp reference] for more information. - -[endsect] -[endsect] diff --git a/deps/boost-process/doc/windows_pseudocode.xml b/deps/boost-process/doc/windows_pseudocode.xml deleted file mode 100644 index 377da22..0000000 --- a/deps/boost-process/doc/windows_pseudocode.xml +++ /dev/null @@ -1,42 +0,0 @@ - - -for (auto & s : seq) - s.on_setup(*this); - -if (error()) -{ - for (auto & s : seq) - s.on_error(*this, error()); - return child(); -} -int err_code = CreateProcess( - exe, - cmd_line, - proc_attrs, - thread_attrs, - creation_flags, - env, - work_dir, - startup_info, - proc_info); - -child c(proc_info, exit_code); - -if (error()) - for (auto & s : seq) - s.on_error(*this, error()); -else - for (auto & s : seq) - s.on_success(*this); - -//now we check again, because a on_success handler might've errored. -if (error()) -{ - for (auto & s : seq) - s.on_error(*this, error()); - return child(); -} -else - return c; - - \ No newline at end of file diff --git a/deps/boost-process/example/Jamfile.jam b/deps/boost-process/example/Jamfile.jam deleted file mode 100644 index 4a9aa06..0000000 --- a/deps/boost-process/example/Jamfile.jam +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2006, 2007 Julio M. Merino Vidal -# Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -# Copyright (c) 2009 Boris Schaeling -# Copyright (c) 2010 Felipe Tanus, Boris Schaeling -# Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -# -# Distributed under the Boost Software License, Version 1.0. (See accompanying -# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -project : requirements - ../../.. - msvc:_SCL_SECURE_NO_WARNINGS - windows:WIN32_LEAN_AND_MEAN -; - -import testing ; - -compile args.cpp ; -compile async_io.cpp ; -compile env.cpp ; -compile error_handling.cpp ; -compile io.cpp ; -compile posix.cpp : no linux:yes ; -compile start_dir.cpp ; -compile sync_io.cpp ; -compile terminate.cpp ; -compile wait.cpp ; -compile windows.cpp : no windows:yes ; diff --git a/deps/boost-process/example/args.cpp b/deps/boost-process/example/args.cpp deleted file mode 100644 index efad00d..0000000 --- a/deps/boost-process/example/args.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#include -#include -#include - -namespace bp = boost::process; - -int main() -{ - bp::child c("test.exe", "--foo", "/bar"); - - //or explicit - - bp::child c2( - bp::exe="test.exe", - bp::args={"--foo", "/bar"} - ); - - c.wait(); - c2.wait(); -} diff --git a/deps/boost-process/example/async_io.cpp b/deps/boost-process/example/async_io.cpp deleted file mode 100644 index 82077c1..0000000 --- a/deps/boost-process/example/async_io.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#include -#include -#include -#include - -namespace bp = boost::process; - -int main() -{ - boost::asio::io_service ios; - boost::asio::streambuf buffer; - - - bp::child c( - "test.exe", - bp::std_out > buffer, - ios - ); - - ios.run(); -} diff --git a/deps/boost-process/example/env.cpp b/deps/boost-process/example/env.cpp deleted file mode 100644 index cb9a609..0000000 --- a/deps/boost-process/example/env.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#include - -namespace bp = boost::process; - -int main() -{ - bp::environment my_env = boost::this_process::environment(); - - my_env["PATH"] += "/foo"; - bp::system("test.exe", my_env); - - - - bp::system("test.exe", bp::env["PATH"]+="/bar"); -} diff --git a/deps/boost-process/example/error_handling.cpp b/deps/boost-process/example/error_handling.cpp deleted file mode 100644 index 1a0dad0..0000000 --- a/deps/boost-process/example/error_handling.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#include -#include - -namespace bp = boost::process; - -int main() -{ - - std::error_code ec; - bp::child c1("test.exe", ec); - - - bp::child c2("test.exe", bp::ignore_error); - -} diff --git a/deps/boost-process/example/intro.cpp b/deps/boost-process/example/intro.cpp deleted file mode 100644 index 4e1127c..0000000 --- a/deps/boost-process/example/intro.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -//[intro -#include - -using namespace boost::process; - -int main() -{ - ipstream pipe_stream; - child c("gcc --version", std_out > pipe_stream); - - std::string line; - - while (pipe_stream && std::getline(pipe_stream, line) && !line.empty()) - std::cerr << line << std::endl; - - c.wait(); -} -//] diff --git a/deps/boost-process/example/io.cpp b/deps/boost-process/example/io.cpp deleted file mode 100644 index 177b3ac..0000000 --- a/deps/boost-process/example/io.cpp +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#include -#include - -namespace bp = boost::process; - -int main() -{ - // - bp::system( - "test.exe", - bp::std_out > stdout, //forward - bp::std_err.close(), //close - bp::std_in < bp::null //null in - ); - - boost::filesystem::path p = "input.txt"; - - bp::system( - "test.exe", - (bp::std_out & bp::std_err) > "output.txt", //redirect both to one file - bp::std_in < p //read input from file - ); - - { - bp::opstream p1; - bp::ipstream p2; - bp::system( - "test.exe", - bp::std_out > p2, - bp::std_in < p1 - ); - p1 << "my_text"; - int i = 0; - p2 >> i; - - } - { - boost::asio::io_service io_service; - bp::async_pipe p1(io_service); - bp::async_pipe p2(io_service); - bp::system( - "test.exe", - bp::std_out > p2, - bp::std_in < p1, - io_service, - bp::on_exit([&](int exit, const std::error_code& ec_in) - { - p1.async_close(); - p2.async_close(); - }) - ); - std::vector in_buf; - std::string value = "my_string"; - boost::asio::async_write(p1, boost::asio::buffer(value), []( const boost::system::error_code&, std::size_t){}); - boost::asio::async_read (p2, boost::asio::buffer(in_buf), []( const boost::system::error_code&, std::size_t){}); - } - { - boost::asio::io_service io_service; - std::vector in_buf; - std::string value = "my_string"; - bp::system( - "test.exe", - bp::std_out > bp::buffer(in_buf), - bp::std_in < bp::buffer(value) - ); - } - - { - boost::asio::io_service io_service; - std::future> in_buf; - std::future write_fut; - std::string value = "my_string"; - bp::system( - "test.exe", - bp::std_out > in_buf, - bp::std_in < bp::buffer(value) > write_fut - ); - - write_fut.get(); - in_buf.get(); - } -} diff --git a/deps/boost-process/example/posix.cpp b/deps/boost-process/example/posix.cpp deleted file mode 100644 index 4e93722..0000000 --- a/deps/boost-process/example/posix.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#include -#include -#include -#include -#include -#include -#include - -namespace bp = boost::process; - -int main() -{ - - //duplicate our pipe descriptor into literal position 4 - bp::pipe p; - bp::system("test", bp::posix::fd.bind(4, p.native_sink())); - - - //close file-descriptor from explicit integral value - bp::system("test", bp::posix::fd.close(STDIN_FILENO)); - - //close file-descriptors from explicit integral values - bp::system("test", bp::posix::fd.close({STDIN_FILENO, STDOUT_FILENO})); - - //add custom handlers - const char *env[2] = { 0 }; - env[0] = "LANG=de"; - bp::system("test", - bp::extend::on_setup([env](auto &e) { e.env = const_cast(env); }), - bp::extend::on_fork_error([](auto&, const std::error_code & ec) - { std::cerr << errno << std::endl; }), - bp::extend::on_exec_setup([](auto&) - { ::chroot("/new/root/directory/"); }), - bp::extend::on_exec_error([](auto&, const std::error_code & ec) - { std::ofstream ofs("log.txt"); if (ofs) ofs << errno; }) - ); - -} diff --git a/deps/boost-process/example/start_dir.cpp b/deps/boost-process/example/start_dir.cpp deleted file mode 100644 index 896ef8c..0000000 --- a/deps/boost-process/example/start_dir.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#include -#include - -namespace bp = boost::process; - -int main() -{ - bp::system( - "test.exe", - bp::start_dir="../foo" - ); - - boost::filesystem::path exe = "test.exe"; - bp::system( - boost::filesystem::absolute(exe), - bp::start_dir="../foo" - ); -} diff --git a/deps/boost-process/example/sync_io.cpp b/deps/boost-process/example/sync_io.cpp deleted file mode 100644 index a861e7a..0000000 --- a/deps/boost-process/example/sync_io.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#include -#include - -namespace bp = boost::process; - -int main() -{ - bp::ipstream p; - - bp::child c( - "test.exe", - bp::std_out > p - ); - - std::string s; - std::getline(p, s); - - c.wait(); -} diff --git a/deps/boost-process/example/terminate.cpp b/deps/boost-process/example/terminate.cpp deleted file mode 100644 index 7de2d83..0000000 --- a/deps/boost-process/example/terminate.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#include - -namespace bp = boost::process; - -int main() -{ - bp::child c("test.exe"); - c.terminate(); -} diff --git a/deps/boost-process/example/wait.cpp b/deps/boost-process/example/wait.cpp deleted file mode 100644 index 3cafe01..0000000 --- a/deps/boost-process/example/wait.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#include -#include - -namespace bp = boost::process; - -int main() -{ - { - bp::child c("test.exe"); - c.wait(); - auto exit_code = c.exit_code(); - } - - { - boost::asio::io_service io_service; - - bp::child c( - "test.exe", - io_service, - bp::on_exit([&](int exit, const std::error_code& ec_in){}) - ); - - io_service.run(); - } -} diff --git a/deps/boost-process/example/windows.cpp b/deps/boost-process/example/windows.cpp deleted file mode 100644 index 98a838c..0000000 --- a/deps/boost-process/example/windows.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#include -#include -#include - -#include - -namespace bp = boost::process; - -int main() -{ - bp::system("test.exe", - bp::windows::show); - - - bp::system("test.exe", - bp::on_setup([](auto &e) - { e.startup_info.dwFlags = STARTF_RUNFULLSCREEN; }), - bp::on_error([](auto&, const std::error_code & ec) - { std::cerr << ec.message() << std::endl; }) - ); -} diff --git a/deps/boost-process/include/boost/process.hpp b/deps/boost-process/include/boost/process.hpp deleted file mode 100644 index e0ad694..0000000 --- a/deps/boost-process/include/boost/process.hpp +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011 Jeff Flinn, Boris Schaeling -// Copyright (c) 2012 Boris Schaeling -// Copyright (c) 2016 Klemens D. Morgenstern -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_HPP -#define BOOST_PROCESS_HPP - -/** - * \file boost/process.hpp - * - * Convenience header which includes all public and platform-independent - * boost.process header files. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#endif diff --git a/deps/boost-process/include/boost/process/args.hpp b/deps/boost-process/include/boost/process/args.hpp deleted file mode 100644 index af677cf..0000000 --- a/deps/boost-process/include/boost/process/args.hpp +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// Copyright (c) 2016 Klemens D. Morgenstern -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_ARGS_HPP -#define BOOST_PROCESS_ARGS_HPP - -/** \file boost/process/args.hpp - * - * This header provides the \xmlonly args\endxmlonly property. It also provides the - * alternative name \xmlonly argv\endxmlonly . - * - * -\xmlonly - -namespace boost { - namespace process { - unspecified args; - unspecified argv; - } -} - -\endxmlonly - */ - - -#include -#include - -namespace boost { namespace process { namespace detail { - -struct args_ -{ - template - using remove_reference_t = typename std::remove_reference::type; - template - using value_type = typename remove_reference_t::value_type; - - template - using vvalue_type = value_type>; - - template - arg_setter_, true> operator()(Range &&range) const - { - return arg_setter_, true>(std::forward(range)); - } - template - arg_setter_, true> operator+=(Range &&range) const - { - return arg_setter_, true>(std::forward(range)); - } - template - arg_setter_, false> operator= (Range &&range) const - { - return arg_setter_, false>(std::forward(range)); - } - template - arg_setter_ operator()(std::basic_string && str) const - { - return arg_setter_ (str); - } - template - arg_setter_ operator+=(std::basic_string && str) const - { - return arg_setter_ (str); - } - template - arg_setter_ operator= (std::basic_string && str) const - { - return arg_setter_(str); - } - template - arg_setter_ operator()(const std::basic_string & str) const - { - return arg_setter_ (str); - } - template - arg_setter_ operator+=(const std::basic_string & str) const - { - return arg_setter_ (str); - } - template - arg_setter_ operator= (const std::basic_string & str) const - { - return arg_setter_(str); - } - template - arg_setter_ operator()(std::basic_string & str) const - { - return arg_setter_ (str); - } - template - arg_setter_ operator+=(std::basic_string & str) const - { - return arg_setter_ (str); - } - template - arg_setter_ operator= (std::basic_string & str) const - { - return arg_setter_(str); - } - template - arg_setter_ operator()(const Char* str) const - { - return arg_setter_ (str); - } - template - arg_setter_ operator+=(const Char* str) const - { - return arg_setter_ (str); - } - template - arg_setter_ operator= (const Char* str) const - { - return arg_setter_(str); - } -// template -// arg_setter_ operator()(const Char (&str) [Size]) const -// { -// return arg_setter_ (str); -// } -// template -// arg_setter_ operator+=(const Char (&str) [Size]) const -// { -// return arg_setter_ (str); -// } -// template -// arg_setter_ operator= (const Char (&str) [Size]) const -// { -// return arg_setter_(str); -// } - - arg_setter_ operator()(std::initializer_list &&range) const - { - return arg_setter_(range.begin(), range.end()); - } - arg_setter_ operator+=(std::initializer_list &&range) const - { - return arg_setter_(range.begin(), range.end()); - } - arg_setter_ operator= (std::initializer_list &&range) const - { - return arg_setter_(range.begin(), range.end()); - } - arg_setter_ operator()(std::initializer_list &&range) const - { - return arg_setter_(range.begin(), range.end()); - } - arg_setter_ operator+=(std::initializer_list &&range) const - { - return arg_setter_(range.begin(), range.end()); - } - arg_setter_ operator= (std::initializer_list &&range) const - { - return arg_setter_(range.begin(), range.end()); - } - - arg_setter_ operator()(std::initializer_list &&range) const - { - return arg_setter_(range.begin(), range.end()); - } - arg_setter_ operator+=(std::initializer_list &&range) const - { - return arg_setter_(range.begin(), range.end()); - } - arg_setter_ operator= (std::initializer_list &&range) const - { - return arg_setter_(range.begin(), range.end()); - } - arg_setter_ operator()(std::initializer_list &&range) const - { - return arg_setter_(range.begin(), range.end()); - } - arg_setter_ operator+=(std::initializer_list &&range) const - { - return arg_setter_(range.begin(), range.end()); - } - arg_setter_ operator= (std::initializer_list &&range) const - { - return arg_setter_(range.begin(), range.end()); - } -}; - - -} -/** - -The `args` property allows to explicitly set arguments for the execution. The -name of the executable will always be the first element in the arg-vector. - -\section args_details Details - -\subsection args_operations Operations - -\subsubsection args_set_var Setting values - -To set a the argument vector the following syntax can be used. - -\code{.cpp} -args = value; -args(value); -\endcode - -`std::initializer_list` is among the allowed types, so the following syntax is also possible. - -\code{.cpp} -args = {value1, value2}; -args({value1, value2}); -\endcode - -Below the possible types for `value` are listed, with `char_type` being either `char` or `wchar_t`. - -\paragraph args_set_var_value value - - - `std::basic_string` - - `const char_type * ` - - `std::initializer_list` - - `std::vector>` - -Additionally any range of `std::basic_string` can be passed. - -\subsubsection args_append_var Appending values - -To append a the argument vector the following syntax can be used. - -\code{.cpp} -args += value; -\endcode - -`std::initializer_list` is among the allowed types, so the following syntax is also possible. - -\code{.cpp} -args += {value1, value2}; -\endcode - -Below the possible types for `value` are listed, with `char_type` being either `char` or `wchar_t`. - -\paragraph args_append_var_value value - - - `std::basic_string` - - `const char_type * ` - - `std::initializer_list` - - `std::vector>` - -Additionally any range of `std::basic_string` can be passed. - - -\subsection args_example Example - -The overload form is used when more than one string is passed, from the second one forward. -I.e. the following expressions have the same results: - -\code{.cpp} -spawn("gcc", "--version"); -spawn("gcc", args ="--version"); -spawn("gcc", args+="--version"); -spawn("gcc", args ={"--version"}); -spawn("gcc", args+={"--version"}); -\endcode - -\note A string will be parsed and set in quotes if it has none and contains spaces. - - - */ -constexpr boost::process::detail::args_ args{}; - -///Alias for \xmlonly args \endxmlonly . -constexpr boost::process::detail::args_ argv{}; - - -}} - -#endif diff --git a/deps/boost-process/include/boost/process/async.hpp b/deps/boost-process/include/boost/process/async.hpp deleted file mode 100644 index 9698aab..0000000 --- a/deps/boost-process/include/boost/process/async.hpp +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) 2016 Klemens D. Morgenstern -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -/** \file boost/process/async.hpp - -The header which provides the basic asynchrounous features. -It provides the on_exit property, which allows callbacks when the process exits. -It also implements the necessary traits for passing an boost::asio::io_service, -which is needed for asynchronous communication. - -It also pulls the [boost::asio::buffer](http://www.boost.org/doc/libs/release/doc/html/boost_asio/reference/buffer.html) -into the boost::process namespace for convenience. - -\xmlonly - -namespace boost { - namespace process { - unspecified buffer; - unspecified on_exit; - } -} - - -\endxmlonly - */ - -#ifndef BOOST_PROCESS_ASYNC_HPP_ -#define BOOST_PROCESS_ASYNC_HPP_ - -#include -#include - -#include -#include -#include -#include -#include - -#if defined(BOOST_POSIX_API) -#include -#include -#include -#include - -#elif defined(BOOST_WINDOWS_API) -#include -#include -#include -#include -#endif - -namespace boost { namespace process { namespace detail { - -struct async_tag; - -template -struct is_io_service : std::false_type {}; -template<> -struct is_io_service : std::true_type {}; - -template -inline asio::io_service& get_io_service(const Tuple & tup) -{ - auto& ref = *boost::fusion::find_if>(tup); - return ref.get(); -} - -struct async_builder -{ - boost::asio::io_service * ios; - - void operator()(boost::asio::io_service & ios_) {this->ios = &ios_;}; - - typedef api::io_service_ref result_type; - api::io_service_ref get_initializer() {return api::io_service_ref (*ios);}; -}; - - -template<> -struct initializer_builder -{ - typedef async_builder type; -}; - -} - -using ::boost::asio::buffer; - - -#if defined(BOOST_PROCESS_DOXYGEN) -/** When an io_service is passed, the on_exit property can be used, to be notified - when the child process exits. - - -The following syntax is valid - -\code{.cpp} -on_exit=function; -on_exit(function); -\endcode - -with `function` being a callable object with the signature `(int, const std::error_code&)` or an -`std::future`. - -\par Example - -\code{.cpp} -io_service ios; - -child c("ls", on_exit=[](int exit, const std::error_code& ec_in){}); - -std::future exit_code; -chlid c2("ls", on_exit=exit_code); - -\endcode - -\note The handler is not invoked when the launch fails. -\warning When used \ref ignore_error it might gte invoked on error. - - */ -constexpr static ::boost::process::detail::on_exit_ on_exit{}; -#endif - -}} - - - -#endif /* INCLUDE_BOOST_PROCESS_DETAIL_ASYNC_HPP_ */ diff --git a/deps/boost-process/include/boost/process/async_pipe.hpp b/deps/boost-process/include/boost/process/async_pipe.hpp deleted file mode 100644 index 97af165..0000000 --- a/deps/boost-process/include/boost/process/async_pipe.hpp +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - - -#ifndef BOOST_PROCESS_ASYNC_PIPE_HPP -#define BOOST_PROCESS_ASYNC_PIPE_HPP - -#include -#include - -#if defined(BOOST_POSIX_API) -#include -#elif defined(BOOST_WINDOWS_API) -#include -#endif - -namespace boost { namespace process { - - -#if defined(BOOST_PROCESS_DOXYGEN) - - -/** Class implementing and asnychronous I/O-Object for use with boost.asio. - * It is based on the corresponding I/O Object, that is either boost::asio::windows::stream_handle or - * boost::asio::posix::stream_descriptor. - * - * It can be used directly with boost::asio::async_read or async_write. - * - * \note The object is copyable, but that does invoke a handle duplicate. - */ -class async_pipe -{ -public: - /** Typedef for the native handle representation. - * \note This is the handle on the system, not the boost.asio class. - * - */ - typedef platform_specific native_handle_type; - /** Typedef for the handle representation of boost.asio. - * - */ - typedef platform_specific handle_type; - - /** Construct a new async_pipe, does automatically open the pipe. - * Initializes source and sink with the same io_service. - * @note Windows creates a named pipe here, where the name is automatically generated. - */ - inline async_pipe(boost::asio::io_service & ios); - - /** Construct a new async_pipe, does automatically open the pipe. - * @note Windows creates a named pipe here, where the name is automatically generated. - */ - inline async_pipe(boost::asio::io_service & ios_source, - boost::asio::io_service & ios_sink); - - /** Construct a new async_pipe, does automatically open. - * Initializes source and sink with the same io_service. - * - * @note Windows restricts possible names. - */ - inline async_pipe(boost::asio::io_service & ios, const std::string & name); - - - /** Construct a new async_pipe, does automatically open. - * - * @note Windows restricts possible names. - */ - inline async_pipe(boost::asio::io_service & ios_source, - boost::asio::io_service & ios_sink, const std::string & name); - - /** Copy-Constructor of the async pipe. - * @note Windows requires a named pipe for this, if a the wrong type is used an exception is thrown. - * - */ - async_pipe(const async_pipe& lhs); - - /** Move-Constructor of the async pipe. - */ - async_pipe(async_pipe&& lhs); - - /** Construct the async-pipe from a pipe. - * @note Windows requires a named pipe for this, if a the wrong type is used an exception is thrown. - * - */ - template> - explicit async_pipe(boost::asio::io_service & ios, const basic_pipe & p); - - /** Construct the async-pipe from a pipe, with two different io_service objects. - * @note Windows requires a named pipe for this, if a the wrong type is used an exception is thrown. - * - */ - template> - explicit async_pipe(boost::asio::io_service & ios_source, - boost::asio::io_service & ios_sink, - const basic_pipe & p); - - - /** Assign a basic_pipe. - * @note Windows requires a named pipe for this, if a the wrong type is used an exception is thrown. - * - */ - template> - inline async_pipe& operator=(const basic_pipe& p); - - /** Copy Assign a pipe. - * @note Duplicates the handles. - */ - async_pipe& operator=(const async_pipe& lhs); - /** Move assign a pipe */ - async_pipe& operator=(async_pipe&& lhs); - - /** Destructor. Closes the pipe handles. */ - ~async_pipe(); - - /** Explicit cast to basic_pipe. */ - template> - inline explicit operator basic_pipe() const; - - /** Cancel the current asynchronous operations. */ - void cancel(); - /** Close the pipe handles. */ - void close(); - /** Close the pipe handles. While passing an error_code - * - */ - void close(std::error_code & ec); - - /** Check if the pipes are open. */ - bool is_open() const; - - /** Async close, i.e. close after current operation is completed. - * - * \note There is no guarantee that this will indeed read the entire pipe-buffer - */ - void async_close(); - - /** Read some data from the handle. - - * See the boost.asio documentation for more details. - */ - template - std::size_t read_some(const MutableBufferSequence & buffers); - - /** Write some data to the handle. - - * See the boost.asio documentation for more details. - */ - template - std::size_t write_some(const MutableBufferSequence & buffers); - - /** Get the native handle of the source. */ - native_handle native_source() const {return const_cast(_source).native();} - /** Get the native handle of the sink. */ - native_handle native_sink () const {return const_cast(_sink ).native();} - - /** Start an asynchronous read. - * - * See the [boost.asio documentation](http://www.boost.org/doc/libs/1_60_0/doc/html/boost_asio/reference/AsyncReadStream.html) for more details. - */ - template - detail::dummy async_read_some( - const MutableBufferSequence & buffers, - ReadHandler &&handler); - - /** Start an asynchronous write. - - * See the [boost.asio documentation](http://www.boost.org/doc/libs/1_60_0/doc/html/boost_asio/reference/AsyncWriteStream.html) for more details. - */ - template - detail::dummy async_write_some( - const ConstBufferSequence & buffers, - WriteHandler && handler); - - ///Get the asio handle of the pipe sink. - const handle_type & sink () const &; - ///Get the asio handle of the pipe source. - const handle_type & source() const &; - - ///Get the asio handle of the pipe sink. Qualified as rvalue - handle_type && sink () &&; - ///Get the asio handle of the pipe source. Qualified as rvalue - handle_type && source() &&; - - /// Move the source out of this class and change the io_service. Qualified as rvalue. \attention Will always move. - handle_type source(::boost::asio::io_service& ios) &&; - /// Move the sink out of this class and change the io_service. Qualified as rvalue. \attention Will always move - handle_type sink (::boost::asio::io_service& ios) &&; - - /// Copy the source out of this class and change the io_service. \attention Will always copy. - handle_type source(::boost::asio::io_service& ios) const &; - /// Copy the sink out of this class and change the io_service. \attention Will always copy - handle_type sink (::boost::asio::io_service& ios) const &; - - - -}; - -#else -using ::boost::process::detail::api::async_pipe; -#endif - - -}} - - - -#endif diff --git a/deps/boost-process/include/boost/process/async_system.hpp b/deps/boost-process/include/boost/process/async_system.hpp deleted file mode 100644 index 08ba6d3..0000000 --- a/deps/boost-process/include/boost/process/async_system.hpp +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// Copyright (c) 2016 Klemens D. Morgenstern -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -/** - * \file boost/process/async_system.hpp - * - * Defines the asynchrounous version of the system function. - */ - -#ifndef BOOST_PROCESS_ASYNC_SYSTEM_HPP -#define BOOST_PROCESS_ASYNC_SYSTEM_HPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if defined(BOOST_POSIX_API) -#include -#endif - -namespace boost { -namespace process { -namespace detail -{ - -template -struct async_system_handler : ::boost::process::detail::api::async_handler -{ - boost::asio::io_service & ios; - boost::asio::detail::async_result_init< - ExitHandler, void(boost::system::error_code, int)> init; - -#if defined(BOOST_POSIX_API) - bool errored = false; -#endif - - template - async_system_handler( - boost::asio::io_service & ios, - ExitHandler_ && exit_handler) : ios(ios), init(std::forward(exit_handler)) - { - - } - - - template - void on_error(Exec & exec, const std::error_code & ec) - { -#if defined(BOOST_POSIX_API) - errored = true; -#endif - auto & h = init.handler; - ios.post( - [h, ec]() mutable - { - h(boost::system::error_code(ec.value(), boost::system::system_category()), -1); - }); - } - - BOOST_ASIO_INITFN_RESULT_TYPE(ExitHandler, void (boost::system::error_code, int)) - get_result() - { - return init.result.get(); - } - - template - std::function on_exit_handler(Executor & exec) - { -#if defined(BOOST_POSIX_API) - if (errored) - return [](int exit_code, const std::error_code & ec){}; -#endif - auto & h = init.handler; - return [h](int exit_code, const std::error_code & ec) mutable - { - h(boost::system::error_code(ec.value(), boost::system::system_category()), exit_code); - }; - } -}; - - -template -struct is_error_handler> : std::true_type {}; - -} - -/** This function provides an asynchronous interface to process launching. - -It uses the same properties and parameters as the other launching function, -but is similar to the asynchronous functions in [boost.asio](http://www.boost.org/doc/libs/release/doc/html/boost_asio.html) - -It uses [asio::async_result](http://www.boost.org/doc/libs/release/doc/html/boost_asio/reference/async_result.html) to determine -the return value (from the second parameter, `exit_handler`). - -\param ios A reference to an [io_service](http://www.boost.org/doc/libs/release/doc/html/boost_asio/reference.html) -\param exit_handler The exit-handler for the signature `void(boost::system::error_code, int)` - -\note This function does not allow custom error handling, since those are done through the `exit_handler`. - -*/ -#if defined(BOOST_PROCESS_DOXYGEN) -template -inline boost::process::detail::dummy - async_system(boost::asio::io_service & ios, ExitHandler && exit_handler, Args && ...args); -#endif - -template -inline BOOST_ASIO_INITFN_RESULT_TYPE(ExitHandler, void (boost::system::error_code, int)) - async_system(boost::asio::io_service & ios, ExitHandler && exit_handler, Args && ...args) -{ - detail::async_system_handler async_h{ios, std::forward(exit_handler)}; - - typedef typename ::boost::process::detail::has_error_handler>::type - has_err_handling; - - static_assert(!has_err_handling::value, "async_system cannot have custom error handling"); - - - child(ios, std::forward(args)..., async_h ).detach(); - - return async_h.get_result(); -} - - - -}} -#endif - diff --git a/deps/boost-process/include/boost/process/child.hpp b/deps/boost-process/include/boost/process/child.hpp deleted file mode 100644 index 980cecd..0000000 --- a/deps/boost-process/include/boost/process/child.hpp +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// Copyright (c) 2016 Klemens D. Morgenstern -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -/** - * \file boost/process/child.hpp - * - * Defines a child process class. - */ - -#ifndef BOOST_PROCESS_CHILD_HPP -#define BOOST_PROCESS_CHILD_HPP - -#include -#include -#include - -#if defined(BOOST_POSIX_API) -#include -#endif - -namespace boost { - -///The main namespace of boost.process. -namespace process { - -template -child::child(Args&&...args) - : child(::boost::process::detail::execute_impl(std::forward(args)...)) {} - - -#if defined(BOOST_PROCESS_DOXYGEN) -/** The main class to hold a child process. It is simliar to [std::thread](http://en.cppreference.com/w/cpp/thread/thread), - * in that it has a join and detach function. - * - * @attention The destructor will call terminate on the process if not joined or detached without any warning. - * - */ - -class child -{ - /** Type definition for the native process handle. */ - typedef platform_specific native_handle_t; - - /** Construct the child from a pid. - * - * @attention There is no guarantee that this will work. The process need the right access rights, which are very platform specific. - */ - explicit child(pid_t & pid) : _child_handle(pid) {}; - - /** Move-Constructor.*/ - child(child && lhs); - - /** Construct a child from a property list and launch it - * The standard version is to create a subprocess, which will spawn the process. - */ - template - explicit child(Args&&...args); - - /** Construct an empty child. */ - child() = default; - - /** Move assign. */ - child& operator=(child && lhs); - - /** Detach the child, i.e. let it run after this handle dies. */ - void detach(); - /** Join the child. This just calls wait, but that way the naming is similar to std::thread */ - void join(); - /** Check if the child is joinable. */ - bool joinable(); - - /** Destructor. - * @attention Will call terminate (without warning) when the child was neither joined nor detached. - */ - ~child(); - - /** Get the native handle for the child process. */ - native_handle_t native_handle() const; - - /** Get the exit_code. The return value is without any meaning if the child wasn't waited for or if it was terminated. */ - int exit_code() const; - /** Get the Process Identifier. */ - pid_t id() const; - - /** Check if the child process is running. */ - bool running(); - /** \overload void running() */ - bool running(std::error_code & ec) noexcept; - - /** Wait for the child process to exit. */ - void wait(); - /** \overload void wait() */ - void wait(std::error_code & ec) noexcept; - - /** Wait for the child process to exit for a period of time. - * \return True if child exited while waiting. - */ - template< class Rep, class Period > - bool wait_for (const std::chrono::duration& rel_time); - /** \overload bool wait_for(const std::chrono::duration& rel_time) */ - bool wait_for (const std::chrono::duration& rel_time, std::error_code & ec) noexcept; - - /** Wait for the child process to exit until a point in time. - * \return True if child exited while waiting.*/ - template< class Clock, class Duration > - bool wait_until(const std::chrono::time_point& timeout_time ); - /** \overload bool wait_until(const std::chrono::time_point& timeout_time )*/ - bool wait_until(const std::chrono::time_point& timeout_time, std::error_code & ec) noexcept; - - /** Check if this handle holds a child process. - * @note That does not mean, that the process is still running. It only means, that the handle does or did exist. - */ - bool valid() const; - /** Same as valid, for convenience. */ - explicit operator bool() const; - - /** Check if the the chlid process is in any process group. */ - bool in_group() const; - - /** \overload bool in_group() const */ - bool in_group(std::error_code & ec) const noexcept; - - /** Terminate the child process. - * - * This function will cause the child process to unconditionally and immediately exit. - * It is implement with [SIGKILL](http://pubs.opengroup.org/onlinepubs/009695399/functions/kill.html) on posix - * and [TerminateProcess](https://technet.microsoft.com/en-us/library/ms686714.aspx) on windows. - * - */ - void terminate(); - - /** \overload void terminate() */ - void terminate(std::error_code & ec) noexcept; -}; - -#endif - -}} -#endif - diff --git a/deps/boost-process/include/boost/process/cmd.hpp b/deps/boost-process/include/boost/process/cmd.hpp deleted file mode 100644 index 79f95e7..0000000 --- a/deps/boost-process/include/boost/process/cmd.hpp +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// Copyright (c) 2016 Klemens D. Morgenstern -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_DETAIL_CMD_LINE_HPP -#define BOOST_PROCESS_DETAIL_CMD_LINE_HPP - -#include -#include -#include -#include -#include - -#if defined(BOOST_POSIX_API) -#include -#elif defined(BOOST_WINDOWS_API) -#include -#endif - -/** \file boost/process/cmd.hpp - * - * This header provides the \xmlonly cmd\endxmlonly property. - * -\xmlonly - -namespace boost { - namespace process { - unspecified cmd; - } -} - -\endxmlonly -*/ - -namespace boost { namespace process { namespace detail { - - -struct cmd_ -{ - constexpr cmd_() {} - - template - inline api::cmd_setter_ operator()(const Char *s) const - { - return api::cmd_setter_(s); - } - template - inline api::cmd_setter_ operator= (const Char *s) const - { - return api::cmd_setter_(s); - } - - template - inline api::cmd_setter_ operator()(const std::basic_string &s) const - { - return api::cmd_setter_(s); - } - template - inline api::cmd_setter_ operator= (const std::basic_string &s) const - { - return api::cmd_setter_(s); - } -}; - -template<> struct is_wchar_t> : std::true_type {}; - - - -template<> -struct char_converter> -{ - static api::cmd_setter_ conv(const api::cmd_setter_ & in) - { - return { ::boost::process::detail::convert(in.str()) }; - } -}; - -template<> -struct char_converter> -{ - static api::cmd_setter_ conv(const api::cmd_setter_ & in) - { - return { ::boost::process::detail::convert(in.str()) }; - } -}; - - - - - - -} - - -/** The cmd property allows to explicitly set commands for the execution. - -The overload form applies when only one string is passed to a launching function. -The string will be internally parsed and split at spaces. - -The following expressions are valid, with `value` being either a C-String or -a `std::basic_string` with `char` or `wchar_t`. - -\code{.cpp} -cmd="value"; -cmd(value); -\endcode - -The property can only be used for assignments. - - - */ -constexpr static ::boost::process::detail::cmd_ cmd; - -}} - -#endif diff --git a/deps/boost-process/include/boost/process/detail/async_handler.hpp b/deps/boost-process/include/boost/process/detail/async_handler.hpp deleted file mode 100644 index 005df39..0000000 --- a/deps/boost-process/include/boost/process/detail/async_handler.hpp +++ /dev/null @@ -1,117 +0,0 @@ -/* - * async_handler.hpp - * - * Created on: 12.06.2016 - * Author: Klemens - */ - -#ifndef BOOST_PROCESS_DETAIL_ASYNC_HANDLER_HPP_ -#define BOOST_PROCESS_DETAIL_ASYNC_HANDLER_HPP_ - -#include - -#if defined(BOOST_POSIX_API) -#include -#include -#include -#else -#include -#include -#endif - -namespace boost { - -namespace process { - -namespace detail { - -#if defined(BOOST_POSIX_API) -using ::boost::process::detail::posix::is_async_handler; -using ::boost::process::detail::posix::does_require_io_service; -#else -using ::boost::process::detail::windows::is_async_handler; -using ::boost::process::detail::windows::does_require_io_service; -#endif - -template -struct has_io_service; - -template -struct has_io_service -{ - typedef typename has_io_service::type next; - typedef typename std::is_same< - typename std::remove_reference::type, - boost::asio::io_service>::type is_ios; - typedef typename std::conditional::type type; -}; - -template -struct has_io_service -{ - typedef typename std::is_same< - typename std::remove_reference::type, - boost::asio::io_service>::type type; -}; - -template -using has_io_service_t = typename has_io_service::type; - -template -struct has_async_handler; - -template -struct has_async_handler -{ - typedef typename has_async_handler::type next; - typedef typename is_async_handler::type is_ios; - typedef typename std::conditional::type type; -}; - -template -struct has_async_handler -{ - typedef typename is_async_handler::type type; -}; - -template -struct needs_io_service; - -template -struct needs_io_service -{ - typedef typename needs_io_service::type next; - typedef typename does_require_io_service::type is_ios; - typedef typename std::conditional::type type; -}; - -template -struct needs_io_service -{ - typedef typename does_require_io_service::type type; -}; - -template -boost::asio::io_service &get_io_service_var(boost::asio::io_service & f, Args&...args) -{ - return f; -} - -template -boost::asio::io_service &get_io_service_var(First & f, Args&...args) -{ - return get_io_service_var(args...); -} - -} -} -} - - -#endif /* BOOST_PROCESS_DETAIL_ASYNC_HANDLER_HPP_ */ diff --git a/deps/boost-process/include/boost/process/detail/basic_cmd.hpp b/deps/boost-process/include/boost/process/detail/basic_cmd.hpp deleted file mode 100644 index 60a2aa8..0000000 --- a/deps/boost-process/include/boost/process/detail/basic_cmd.hpp +++ /dev/null @@ -1,292 +0,0 @@ -// Copyright (c) 2016 Klemens D. Morgenstern -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - - -#ifndef BOOST_PROCESS_DETAIL_BASIC_CMD_HPP_ -#define BOOST_PROCESS_DETAIL_BASIC_CMD_HPP_ - -#include - -#include -#include -#include - -#if defined( BOOST_WINDOWS_API ) -#include -#include -#elif defined( BOOST_POSIX_API ) -#include -#include -#endif - -#include - -#include - - -namespace boost { namespace process { namespace detail { - -template -struct exe_setter_ -{ - typedef Char value_type; - typedef std::basic_string string_type; - - string_type exe_; - exe_setter_(string_type && str) : exe_(std::move(str)) {} - exe_setter_(const string_type & str) : exe_(str) {} -}; - -template<> struct is_wchar_t> : std::true_type {}; - - -template<> -struct char_converter> -{ - static exe_setter_ conv(const exe_setter_ & in) - { - return {::boost::process::detail::convert(in.exe_)}; - } -}; - -template<> -struct char_converter> -{ - static exe_setter_ conv(const exe_setter_ & in) - { - return {::boost::process::detail::convert(in.exe_)}; - } -}; - - - -template -struct arg_setter_ -{ - using value_type = Char; - using string_type = std::basic_string; - std::vector _args; - - typedef typename std::vector::iterator iterator; - typedef typename std::vector::const_iterator const_iterator; - - template - arg_setter_(Iterator && begin, Iterator && end) : _args(begin, end) {} - - template - arg_setter_(Range && str) : - _args(std::begin(str), - std::end(str)) {} - - iterator begin() {return _args.begin();} - iterator end() {return _args.end();} - const_iterator begin() const {return _args.begin();} - const_iterator end() const {return _args.end();} - arg_setter_(string_type & str) : _args{{str}} {} - arg_setter_(string_type && s) : _args({std::move(s)}) {} - arg_setter_(const string_type & s) : _args({s}) {} - arg_setter_(const value_type* s) : _args({std::move(s)}) {} - - template - arg_setter_(const value_type (&s) [Size]) : _args({s}) {} -}; - -template<> struct is_wchar_t> : std::true_type {}; -template<> struct is_wchar_t> : std::true_type {}; - -template<> -struct char_converter> -{ - static arg_setter_ conv(const arg_setter_ & in) - { - std::vector vec(in._args.size()); - std::transform(in._args.begin(), in._args.end(), vec.begin(), - [](const std::wstring & ws) - { - return ::boost::process::detail::convert(ws); - }); - return {vec}; - } -}; - -template<> -struct char_converter> -{ - static arg_setter_ conv(const arg_setter_ & in) - { - std::vector vec(in._args.size()); - std::transform(in._args.begin(), in._args.end(), vec.begin(), - [](const std::string & ws) - { - return ::boost::process::detail::convert(ws); - }); - - return {vec}; - } -}; - -template<> -struct char_converter> -{ - static arg_setter_ conv(const arg_setter_ & in) - { - std::vector vec(in._args.size()); - std::transform(in._args.begin(), in._args.end(), vec.begin(), - [](const std::wstring & ws) - { - return ::boost::process::detail::convert(ws); - }); - return {vec}; } -}; - -template<> -struct char_converter> -{ - static arg_setter_ conv(const arg_setter_ & in) - { - std::vector vec(in._args.size()); - std::transform(in._args.begin(), in._args.end(), vec.begin(), - [](const std::string & ws) - { - return ::boost::process::detail::convert(ws); - }); - return {vec}; - } -}; - -using api::exe_cmd_init; - -template -struct exe_builder -{ - //set by path, because that will not be interpreted as a cmd - bool not_cmd = false; - bool shell = false; - using string_type = std::basic_string; - string_type exe; - std::vector args; - - void operator()(const boost::filesystem::path & data) - { - not_cmd = true; - if (exe.empty()) - exe = data.native(); - else - args.push_back(data.native()); - } - - void operator()(const string_type & data) - { - if (exe.empty()) - exe = data; - else - args.push_back(data); - } - void operator()(const Char* data) - { - if (exe.empty()) - exe = data; - else - args.push_back(data); - } - void operator()(shell_) {shell = true;} - void operator()(std::vector && data) - { - if (data.empty()) - return; - - auto itr = std::make_move_iterator(data.begin()); - auto end = std::make_move_iterator(data.end()); - - if (exe.empty()) - { - exe = *itr; - itr++; - } - args.insert(args.end(), itr, end); - } - - void operator()(const std::vector & data) - { - if (data.empty()) - return; - - auto itr = data.begin(); - auto end = data.end(); - - if (exe.empty()) - { - exe = *itr; - itr++; - } - args.insert(args.end(), itr, end); - } - void operator()(exe_setter_ && data) - { - not_cmd = true; - exe = std::move(data.exe_); - } - void operator()(const exe_setter_ & data) - { - not_cmd = true; - exe = data.exe_; - } - void operator()(arg_setter_ && data) - { - args.assign( - std::make_move_iterator(data._args.begin()), - std::make_move_iterator(data._args.end())); - } - void operator()(arg_setter_ && data) - { - args.insert(args.end(), - std::make_move_iterator(data._args.begin()), - std::make_move_iterator(data._args.end())); - } - void operator()(const arg_setter_ & data) - { - args.assign(data._args.begin(), data._args.end()); - } - void operator()(const arg_setter_ & data) - { - args.insert(args.end(), data._args.begin(), data._args.end()); - } - - api::exe_cmd_init get_initializer() - { - if (not_cmd || !args.empty()) - { - if (shell) - return api::exe_cmd_init::exe_args_shell(std::move(exe), std::move(args)); - else - return api::exe_cmd_init::exe_args(std::move(exe), std::move(args)); - } - else - if (shell) - return api::exe_cmd_init::cmd_shell(std::move(exe)); - else - return api::exe_cmd_init::cmd(std::move(exe)); - - } - typedef api::exe_cmd_init result_type; -}; - -template<> -struct initializer_builder> -{ - typedef exe_builder type; -}; - -template<> -struct initializer_builder> -{ - typedef exe_builder type; -}; - -}}} - - - -#endif /* BOOST_PROCESS_DETAIL_EXE_BUILDER_HPP_ */ diff --git a/deps/boost-process/include/boost/process/detail/child_decl.hpp b/deps/boost-process/include/boost/process/detail/child_decl.hpp deleted file mode 100644 index 3483f7c..0000000 --- a/deps/boost-process/include/boost/process/detail/child_decl.hpp +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// Copyright (c) 2016 Klemens D. Morgenstern -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -/** - * \file boost/process/child.hpp - * - * Defines a child process class. - */ - -#ifndef BOOST_PROCESS_CHILD_DECL_HPP -#define BOOST_PROCESS_CHILD_DECL_HPP - -#include -#include -#include - -#include -#include - -#if defined(BOOST_POSIX_API) -#include -#include -#include -#include -#elif defined(BOOST_WINDOWS_API) -#include -#include -#include -#include - -#endif -namespace boost { - -namespace process { - -using ::boost::process::detail::api::pid_t; - -class child -{ - ::boost::process::detail::api::child_handle _child_handle; - std::shared_ptr> _exit_status = std::make_shared>(::boost::process::detail::api::still_active); - bool _attached = true; - bool _terminated = false; - - bool _exited() - { - return _terminated || !::boost::process::detail::api::is_running(_exit_status->load()); - }; -public: - typedef ::boost::process::detail::api::child_handle child_handle; - typedef child_handle::process_handle_t native_handle_t; - explicit child(child_handle &&ch, std::shared_ptr> &ptr) : _child_handle(std::move(ch)), _exit_status(ptr) {} - explicit child(child_handle &&ch, const std::shared_ptr> &ptr) : _child_handle(std::move(ch)), _exit_status(ptr) {} - explicit child(child_handle &&ch) : _child_handle(std::move(ch)) {} - - explicit child(pid_t & pid) : _child_handle(pid), _attached(false) {}; - child(const child&) = delete; - child(child && lhs) noexcept - : _child_handle(std::move(lhs._child_handle)), - _exit_status(std::move(lhs._exit_status)), - _attached (lhs._attached) - { - lhs._attached = false; - } - - template - explicit child(Args&&...args); - child() {} - child& operator=(const child&) = delete; - child& operator=(child && lhs) - { - _child_handle= std::move(lhs._child_handle); - _exit_status = std::move(lhs._exit_status); - _attached = lhs._attached; - lhs._attached = false; - return *this; - }; - - void detach() {_attached = false; } - void join() {wait();} - bool joinable() { return _attached;} - - ~child() - { - std::error_code ec; - if (_attached && !_exited() && running(ec)) - terminate(ec); - } - native_handle_t native_handle() const { return _child_handle.process_handle(); } - - - int exit_code() const {return ::boost::process::detail::api::eval_exit_status(_exit_status->load());} - pid_t id() const {return _child_handle.id(); } - - bool running() - { - if (valid() && !_exited()) - { - int code; - auto res = boost::process::detail::api::is_running(_child_handle, code); - if (!res && !_exited()) - _exit_status->store(code); - - return res; - } - return false; - } - - void terminate() - { - if (valid() && running()) - boost::process::detail::api::terminate(_child_handle); - - _terminated = true; - } - - void wait() - { - if (!_exited() && valid()) - { - int exit_code = 0; - boost::process::detail::api::wait(_child_handle, exit_code); - _exit_status->store(exit_code); - } - } - - template< class Rep, class Period > - bool wait_for (const std::chrono::duration& rel_time) - { - if (!_exited()) - { - int exit_code = 0; - auto b = boost::process::detail::api::wait_for(_child_handle, exit_code, rel_time); - if (!b) - return false; - _exit_status->store(exit_code); - } - return true; - } - - template< class Clock, class Duration > - bool wait_until(const std::chrono::time_point& timeout_time ) - { - if (!_exited()) - { - int exit_code = 0; - auto b = boost::process::detail::api::wait_until(_child_handle, exit_code, timeout_time); - if (!b) - return false; - _exit_status->store(exit_code); - } - return true; - } - - bool running(std::error_code & ec) noexcept - { - if (valid() && !_exited()) - { - int code; - auto res = boost::process::detail::api::is_running(_child_handle, code, ec); - if (!res && !_exited()) - _exit_status->store(code); - - return res; - } - return false; - } - - void terminate(std::error_code & ec) noexcept - { - if (valid() && running(ec)) - boost::process::detail::api::terminate(_child_handle, ec); - - _terminated = true; - } - - void wait(std::error_code & ec) noexcept - { - if (!_exited() && valid()) - { - int exit_code = 0; - boost::process::detail::api::wait(_child_handle, exit_code, ec); - _exit_status->store(exit_code); - } - } - - template< class Rep, class Period > - bool wait_for (const std::chrono::duration& rel_time, std::error_code & ec) noexcept - { - if (!_exited()) - { - int exit_code = 0; - auto b = boost::process::detail::api::wait_for(_child_handle, exit_code, rel_time, ec); - if (!b) - return false; - _exit_status->store(exit_code); - } - return true; - } - - template< class Clock, class Duration > - bool wait_until(const std::chrono::time_point& timeout_time, std::error_code & ec) noexcept - { - if (!_exited()) - { - int exit_code = 0; - auto b = boost::process::detail::api::wait_until(_child_handle, exit_code, timeout_time, ec); - if (!b) - return false; - _exit_status->store(exit_code); - } - return true; - } - - - bool valid() const - { - return _child_handle.valid(); - } - operator bool() const {return valid();} - - bool in_group() const - { - return _child_handle.in_group(); - } - bool in_group(std::error_code &ec) const noexcept - { - return _child_handle.in_group(ec); - } -}; - - - -}} -#endif - diff --git a/deps/boost-process/include/boost/process/detail/config.hpp b/deps/boost-process/include/boost/process/detail/config.hpp deleted file mode 100644 index 2e280c1..0000000 --- a/deps/boost-process/include/boost/process/detail/config.hpp +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// Copyright (c) 2016 Klemens D. Morgenstern -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -/** - * \file boost/process/config.hpp - * - * Defines various macros. - */ - -#ifndef BOOST_PROCESS_DETAIL_CONFIG_HPP -#define BOOST_PROCESS_DETAIL_CONFIG_HPP - -#include -#include -#include - -#include - -#if defined(BOOST_POSIX_API) -#include -#if defined(__GLIBC__) -#include -#else -extern char **environ; -#endif -#elif defined(BOOST_WINDOWS_API) -#include -#else -#error "System API not supported by boost.process" -#endif - -namespace boost { namespace process { namespace detail -{ - -#if !defined(BOOST_PROCESS_PIPE_SIZE) -#define BOOST_PROCESS_PIPE_SIZE 1024 -#endif - -#if defined(BOOST_POSIX_API) -namespace posix {namespace extensions {}} -namespace api = posix; - -inline std::error_code get_last_error() noexcept -{ - return std::error_code(errno, std::system_category()); -} - -//copied from linux spec. -#if defined (__USE_XOPEN_EXTENDED) && !defined (__USE_XOPEN2K8) || defined( __USE_BSD) -#define BOOST_POSIX_HAS_VFORK 1 -#endif - -#elif defined(BOOST_WINDOWS_API) -namespace windows {namespace extensions {}} -namespace api = windows; - -inline std::error_code get_last_error() noexcept -{ - return std::error_code(::boost::detail::winapi::GetLastError(), std::system_category()); -} -#endif - -inline void throw_last_error(const std::string & msg) -{ - throw process_error(get_last_error(), msg); -} - -inline void throw_last_error() -{ - throw process_error(get_last_error()); -} - - -template constexpr Char null_char(); -template<> constexpr char null_char (){return '\0';} -template<> constexpr wchar_t null_char (){return L'\0';} - -template constexpr Char equal_sign(); -template<> constexpr char equal_sign () {return '='; } -template<> constexpr wchar_t equal_sign () {return L'='; } - -template constexpr Char quote_sign(); -template<> constexpr char quote_sign () {return '"'; } -template<> constexpr wchar_t quote_sign () {return L'"'; } - -template constexpr Char space_sign(); -template<> constexpr char space_sign () {return ' '; } -template<> constexpr wchar_t space_sign () {return L' '; } - - -}}} -#endif diff --git a/deps/boost-process/include/boost/process/detail/execute_impl.hpp b/deps/boost-process/include/boost/process/detail/execute_impl.hpp deleted file mode 100644 index 77722f7..0000000 --- a/deps/boost-process/include/boost/process/detail/execute_impl.hpp +++ /dev/null @@ -1,284 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// Copyright (c) 2016 Klemens D. Morgenstern -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -/** - * \file boost/process/execute.hpp - * - * Defines a function to execute a program. - */ - -#ifndef BOOST_PROCESS_EXECUTE_HPP -#define BOOST_PROCESS_EXECUTE_HPP - -#include -#include - -#if defined(BOOST_POSIX_API) -#include -#elif defined(BOOST_WINDOWS_API) -#include -#endif - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -namespace boost { namespace process { - -class child; - -namespace detail { - - -template -struct has_wchar; - -template -struct has_wchar -{ - typedef has_wchar next; - typedef typename std::remove_cv< - typename std::remove_reference::type>::type res_type; - - constexpr static bool my_value = is_wchar_t::value; - constexpr static bool value = my_value || next::value; - - typedef std::integral_constant type; -}; - -template -struct has_wchar -{ - typedef typename std::remove_cv< - typename std::remove_reference::type>::type res_type; - - constexpr static bool value = is_wchar_t::value; - - typedef std::integral_constant type; -}; - - -#if defined(BOOST_WINDOWS_API) -//everything needs to be wchar_t -#if defined(BOOST_NO_ANSI_APIS) -template -struct required_char_type -{ - typedef wchar_t type; -}; -#else -template struct required_char_type; -template<> struct required_char_type -{ - typedef wchar_t type; -}; -template<> struct required_char_type -{ - typedef char type; -}; -#endif - -#elif defined(BOOST_POSIX_API) -template -struct required_char_type -{ - typedef char type; -}; -#endif - -template -using required_char_type_t = typename required_char_type< - has_wchar::value>::type; - - -template -struct make_builders_from_view -{ - typedef boost::fusion::set set; - typedef typename boost::fusion::result_of::deref::type ref_type; - typedef typename std::remove_reference::type res_type; - typedef typename initializer_tag::type tag; - typedef typename initializer_builder::type builder_type; - typedef typename boost::fusion::result_of::has_key has_key; - - typedef typename boost::fusion::result_of::next::type next_itr; - typedef typename make_builders_from_view::type next; - - typedef typename - std::conditional::type, - typename make_builders_from_view::type - >::type type; - -}; - -template -struct make_builders_from_view -{ - typedef boost::fusion::set type; -}; - -template -struct builder_ref -{ - Builders &builders; - builder_ref(Builders & builders) : builders(builders) {}; - - template - void operator()(T && value) const - { - typedef typename initializer_tag::type>::type tag; - typedef typename initializer_builder::type builder_type; - boost::fusion::at_key(builders)(std::forward(value)); - } -}; - -template -struct get_initializers_result -{ - typedef typename T::result_type type; -}; - -template<> -struct get_initializers_result -{ - typedef boost::fusion::void_ type; -}; - -template -struct helper_vector -{ - -}; - -template -struct invoke_get_initializer_collect_keys; - -template -struct invoke_get_initializer_collect_keys, Stack...> -{ - typedef helper_vector type; -}; - - -template -struct invoke_get_initializer_collect_keys, Stack...> -{ - typedef typename invoke_get_initializer_collect_keys, Stack..., First>::type next; - typedef helper_vector stack_t; - - typedef typename std::conditional::value, - stack_t, next>::type type; - - -}; - - -template -struct invoke_get_initializer; - -template -struct invoke_get_initializer> - -{ - typedef boost::fusion::tuple::type...> result_type; - - template - static result_type call(Sequence & seq) - { - return result_type(boost::fusion::at_key(seq).get_initializer()...);; - } -}; - - - - - -template -inline boost::fusion::tuple::type...> - get_initializers(boost::fusion::set & builders) -{ - //typedef boost::fusion::tuple::type...> return_type; - typedef typename invoke_get_initializer_collect_keys>::type keys; - return invoke_get_initializer::call(builders); -} - - -template -inline child basic_execute_impl(Args && ... args) -{ - //create a tuple from the argument list - boost::fusion::tuple::type&...> tup(args...); - - auto inits = boost::fusion::filter_if< - boost::process::detail::is_initializer< - typename std::remove_reference< - boost::mpl::_ - >::type - > - >(tup); - - auto others = boost::fusion::filter_if< - boost::mpl::not_< - boost::process::detail::is_initializer< - typename std::remove_reference< - boost::mpl::_ - >::type - > - > - >(tup); - - // typename detail::make_builders_from_view::type builders; - - //typedef typename boost::fusion::result_of::as_vector::type inits_t; - typedef typename boost::fusion::result_of::as_vector::type others_t; - // typedef decltype(others) others_t; - typedef typename ::boost::process::detail::make_builders_from_view< - typename boost::fusion::result_of::begin::type, - typename boost::fusion::result_of::end ::type>::type builder_t; - - builder_t builders; - ::boost::process::detail::builder_ref builder_ref(builders); - - boost::fusion::for_each(others, builder_ref); - auto other_inits = ::boost::process::detail::get_initializers(builders); - - - boost::fusion::joint_view complete_inits(other_inits, inits); - - auto exec = boost::process::detail::api::make_executor(complete_inits); - return exec(); -} - -template -inline child execute_impl(Args&& ... args) -{ - typedef required_char_type_t req_char_type; - - return basic_execute_impl( - boost::process::detail::char_converter_t::conv( - std::forward(args))... - ); -} - -}}} - - -#endif diff --git a/deps/boost-process/include/boost/process/detail/handler.hpp b/deps/boost-process/include/boost/process/detail/handler.hpp deleted file mode 100644 index 2a35185..0000000 --- a/deps/boost-process/include/boost/process/detail/handler.hpp +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) 2016 Klemens D. Morgenstern -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - - -#ifndef BOOST_PROCESS_DETAIL_HANDLER_HPP_ -#define BOOST_PROCESS_DETAIL_HANDLER_HPP_ - -#include - -#if defined(BOOST_POSIX_API) -#include -#elif defined(BOOST_WINDOWS_API) -#include -#endif - - -namespace boost { namespace process { namespace detail { - -//extended handler base. -typedef api::handler_base_ext handler; - - -template -struct on_setup_ : handler -{ - explicit on_setup_(Handler handler) : handler_(handler) {} - - template - void on_setup(Executor &e) - { - handler_(e); - } -private: - Handler handler_; -}; - -template -struct on_error_ : handler -{ - explicit on_error_(Handler handler) : handler_(handler) {} - - template - void on_error(Executor &e, const std::error_code &ec) - { - handler_(e, ec); - } -private: - Handler handler_; -}; - -template -struct on_success_ : handler -{ - explicit on_success_(Handler handler) : handler_(handler) {} - - template - void on_success(Executor &e) - { - handler_(e); - } -private: - Handler handler_; -}; - -} - - - -}} - - - -#endif /* BOOST_PROCESS_DETAIL_HANDLER_HPP_ */ diff --git a/deps/boost-process/include/boost/process/detail/handler_base.hpp b/deps/boost-process/include/boost/process/detail/handler_base.hpp deleted file mode 100644 index 93a8052..0000000 --- a/deps/boost-process/include/boost/process/detail/handler_base.hpp +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling -// Copyright (c) 2016 Klemens D. Morgenstern -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_PROCESS_DETAIL_HANDLER_BASE_HPP -#define BOOST_PROCESS_DETAIL_HANDLER_BASE_HPP - -#include - -namespace boost { namespace process { namespace detail { - -template