start_in_dir.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 <filesystem>
14 #include <string>
15 
17 {
18 
19  template <class String>
21  {
22  public:
23  explicit start_in_dir_(const String& s) : s_(s) {}
24 
25  template <class WindowsExecutor>
26  void on_CreateProcess_setup(WindowsExecutor& e) const
27  {
28  e.work_dir = s_.c_str();
29  }
30 
31  private:
32  String s_;
33  };
34 
35 #if defined(_UNICODE) || defined(UNICODE)
36  inline start_in_dir_<std::wstring> start_in_dir(const wchar_t* ws)
37  {
38  return start_in_dir_<std::wstring>(ws);
39  }
40 
41  inline start_in_dir_<std::wstring> start_in_dir(const std::wstring& ws)
42  {
43  return start_in_dir_<std::wstring>(ws);
44  }
45 
46  inline start_in_dir_<std::wstring> start_in_dir(const std::filesystem::path& p)
47  {
48  return start_in_dir_<std::wstring>(p.wstring());
49  }
50 #else
52  {
54  }
55 
56  inline start_in_dir_<std::string> start_in_dir(const std::string& s)
57  {
59  }
60 
61  inline start_in_dir_<std::string> start_in_dir(const std::filesystem::path& p)
62  {
63  return start_in_dir_<std::string>(p.string());
64  }
65 #endif
66 
67 }
boost::process::windows::initializers::start_in_dir_::on_CreateProcess_setup
void on_CreateProcess_setup(WindowsExecutor &e) const
Definition: start_in_dir.hpp:26
boost::process::windows::initializers::start_in_dir_
Definition: start_in_dir.hpp:20
boost::process::windows::initializers::start_in_dir_::start_in_dir_
start_in_dir_(const String &s)
Definition: start_in_dir.hpp:23
boost::process::windows::initializers::start_in_dir
start_in_dir_< std::string > start_in_dir(const char *s)
Definition: start_in_dir.hpp:51
boost::process::windows::initializers
Definition: bind_stderr.hpp:16
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