env_init.hpp 979 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright (c) 2016 Klemens D. Morgenstern
  2. //
  3. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. #ifndef BOOST_PROCESS_DETAIL_POSIX_ENV_INIT_HPP_
  6. #define BOOST_PROCESS_DETAIL_POSIX_ENV_INIT_HPP_
  7. #include <boost/process/detail/config.hpp>
  8. #include <boost/process/detail/posix/handler.hpp>
  9. #include <boost/process/environment.hpp>
  10. namespace boost { namespace process { namespace detail { namespace posix {
  11. template<typename Char>
  12. struct env_init;
  13. template<>
  14. struct env_init<char> : handler_base_ext
  15. {
  16. boost::process::environment env;
  17. env_init(boost::process::environment && env) : env(std::move(env)) {};
  18. env_init(const boost::process::environment & env) : env(env) {};
  19. template <class Executor>
  20. void on_setup(Executor &exec) const
  21. {
  22. exec.env = env._env_impl;
  23. }
  24. };
  25. }}}}
  26. #endif /* BOOST_PROCESS_DETAIL_WINDOWS_ENV_INIT_HPP_ */