cmd.hpp 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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_WINDOWS_CMD_HPP_
  6. #define BOOST_PROCESS_WINDOWS_CMD_HPP_
  7. #include <string>
  8. namespace boost
  9. {
  10. namespace process
  11. {
  12. BOOST_PROCESS_V1_INLINE namespace v1
  13. {
  14. namespace detail
  15. {
  16. namespace windows
  17. {
  18. template<typename CharType>
  19. struct cmd_setter_ : ::boost::process::v1::detail::handler_base
  20. {
  21. typedef CharType value_type;
  22. typedef std::basic_string<value_type> string_type;
  23. cmd_setter_(string_type && cmd_line) : _cmd_line(std::move(cmd_line)) {}
  24. cmd_setter_(const string_type & cmd_line) : _cmd_line(cmd_line) {}
  25. template <class Executor>
  26. void on_setup(Executor& exec)
  27. {
  28. exec.cmd_line = _cmd_line.c_str();
  29. }
  30. const string_type & str() const {return _cmd_line;}
  31. private:
  32. string_type _cmd_line;
  33. };
  34. }
  35. }
  36. }
  37. }
  38. }
  39. #endif /* INCLUDE_BOOST_PROCESS_WINDOWS_ARGS_HPP_ */