set_cmd_line.hpp
Go to the documentation of this file.
1 // Copyright (c) 2006, 2007 Julio M. Merino Vidal
2 // Copyright (c) 2008 Ilya Sokolov, Boris Schaeling
3 // Copyright (c) 2009 Boris Schaeling
4 // Copyright (c) 2010 Felipe Tanus, Boris Schaeling
5 // Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling
6 //
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 
10 #pragma once
11 
13 #include <boost/range/algorithm/copy.hpp>
14 #include <boost/shared_array.hpp>
15 #include <memory>
16 
18 {
19 
20  template <class String>
22  {
23  private:
24  using Char = typename String::value_type;
25 
26  public:
27  explicit set_cmd_line_(const String& s)
28  : cmd_line_(new Char[s.size() + 1])
29  {
30  boost::copy(s, cmd_line_.get());
31  cmd_line_[s.size()] = 0;
32  }
33 
34  template <class WindowsExecutor>
35  void on_CreateProcess_setup(WindowsExecutor& e) const
36  {
37  e.cmd_line = cmd_line_.get();
38  }
39 
40  private:
41  boost::shared_array<Char> cmd_line_;
42  };
43 
44 #if defined(_UNICODE) || defined(UNICODE)
45  inline set_cmd_line_<std::wstring> set_cmd_line(const wchar_t* ws)
46  {
47  return set_cmd_line_<std::wstring>(ws);
48  }
49 
50  inline set_cmd_line_<std::wstring> set_cmd_line(const std::wstring& ws)
51  {
52  return set_cmd_line_<std::wstring>(ws);
53  }
54 #else
56  {
58  }
59 
60  inline set_cmd_line_<std::string> set_cmd_line(const std::string& s)
61  {
63  }
64 #endif
65 
66 }
boost::process::windows::initializers::set_cmd_line_::on_CreateProcess_setup
void on_CreateProcess_setup(WindowsExecutor &e) const
Definition: set_cmd_line.hpp:35
boost::process::windows::initializers::set_cmd_line_
Definition: set_cmd_line.hpp:21
boost::process::windows::initializers::set_cmd_line_::set_cmd_line_
set_cmd_line_(const String &s)
Definition: set_cmd_line.hpp:27
boost::process::windows::initializers::set_cmd_line
set_cmd_line_< std::string > set_cmd_line(const char *s)
Definition: set_cmd_line.hpp:55
boost::process::windows::initializers
Definition: bind_stderr.hpp:16
copy
Use of this software is granted under one of the following two to be chosen freely by the user Boost Software License Version Marcin Kalicinski Permission is hereby free of to any person or organization obtaining a copy of the software and accompanying documentation covered by this and transmit the and to prepare derivative works of the and to permit third parties to whom the Software is furnished to do all subject to the including the above license this restriction and the following must be included in all copies of the in whole or in and all derivative works of the unless such copies or derivative works are solely in the form of machine executable object code generated by a source language processor THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF FITNESS FOR A PARTICULAR TITLE AND NON INFRINGEMENT IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN TORT OR ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE The MIT Marcin Kalicinski Permission is hereby free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to copy
Definition: license.txt:39
cxxopts::String
std::string String
Definition: cxxopts.hpp:209
initializer_base.hpp
boost::process::windows::initializers::initializer_base
Definition: initializer_base.hpp:15
armarx::ctrlutil::s
double s(double t, double s0, double v0, double a0, double j)
Definition: CtrlUtil.h:33