cmd.hpp 993 B

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