/usr/include/boost/process/detail/windows
NameSizeModeActions
asio_fwd.hpp13540644editdlrm
async_handler.hpp11950644editdlrm
async_in.hpp35570644editdlrm
async_out.hpp60790644editdlrm
async_pipe.hpp176110644editdlrm
basic_cmd.hpp50720644editdlrm
basic_pipe.hpp84510644editdlrm
child_handle.hpp31850644editdlrm
close_in.hpp10400644editdlrm
close_out.hpp17430644editdlrm
cmd.hpp9930644editdlrm
compare_handles.hpp14880644editdlrm
environment.hpp109760644editdlrm
env_init.hpp16150644editdlrm
executor.hpp80450644editdlrm
file_descriptor.hpp37470644editdlrm
file_in.hpp17350644editdlrm
file_out.hpp26910644editdlrm
group_handle.hpp65270644editdlrm
group_ref.hpp15720644editdlrm
handler.hpp5660644editdlrm
handles.hpp57460644editdlrm
handle_workaround.hpp89240644editdlrm
io_context_ref.hpp50430644editdlrm
is_running.hpp14110644editdlrm
job_workaround.hpp97210644editdlrm
locale.hpp31540644editdlrm
null_in.hpp15590644editdlrm
null_out.hpp25760644editdlrm
on_exit.hpp12020644editdlrm
pipe_in.hpp25710644editdlrm
pipe_out.hpp35350644editdlrm
search_path.hpp28080644editdlrm
shell_path.hpp15680644editdlrm
show_window.hpp13080644editdlrm
start_dir.hpp10260644editdlrm
terminate.hpp13290644editdlrm
wait_for_exit.hpp40480644editdlrm
wait_group.hpp43370644editdlrm
Edit: /usr/include/boost/process/detail/windows/basic_cmd.hpp (5072B)
// Copyright (c) 2016 Klemens D. Morgenstern // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROCESS_DETAIL_WINDOWS_BASIC_CMD_HPP_ #define BOOST_PROCESS_DETAIL_WINDOWS_BASIC_CMD_HPP_ #include #include #include #include #include #include #include namespace boost { namespace process { namespace detail { namespace windows { inline std::string build_args(const std::string & exe, std::vector && data) { std::string st = exe; //put in quotes if it has spaces or double quotes if(!exe.empty()) { auto it = st.find_first_of(" \""); if(it != st.npos)//contains spaces. { // double existing quotes boost::replace_all(st, "\"", "\"\""); // surround with quotes st.insert(st.begin(), '"'); st += '"'; } } for (auto & arg : data) { if(!arg.empty()) { auto it = arg.find_first_of(" \"");//contains space or double quotes? if(it != arg.npos)//yes { // double existing quotes boost::replace_all(arg, "\"", "\"\""); // surround with quotes arg.insert(arg.begin(), '"'); arg += '"'; } } if (!st.empty())//first one does not need a preceeding space st += ' '; st += arg; } return st; } inline std::wstring build_args(const std::wstring & exe, std::vector && data) { std::wstring st = exe; //put in quotes if it has spaces or double quotes if(!exe.empty()) { auto it = st.find_first_of(L" \""); if(it != st.npos)//contains spaces or double quotes. { // double existing quotes boost::replace_all(st, L"\"", L"\"\""); // surround with quotes st.insert(st.begin(), L'"'); st += L'"'; } } for(auto & arg : data) { if(!arg.empty()) { auto it = arg.find_first_of(L" \"");//contains space or double quotes? if(it != arg.npos)//yes { // double existing quotes boost::replace_all(arg, L"\"", L"\"\""); // surround with quotes arg.insert(arg.begin(), L'"'); arg += '"'; } } if (!st.empty())//first one does not need a preceeding space st += L' '; st += arg; } return st; } template struct exe_cmd_init : handler_base_ext { using value_type = Char; using string_type = std::basic_string; static const char* c_arg(char) { return "/c";} static const wchar_t* c_arg(wchar_t) { return L"/c";} exe_cmd_init(const string_type & exe, bool cmd_only = false) : exe(exe), args({}), cmd_only(cmd_only) {}; exe_cmd_init(string_type && exe, bool cmd_only = false) : exe(std::move(exe)), args({}), cmd_only(cmd_only) {}; exe_cmd_init(string_type && exe, std::vector && args) : exe(std::move(exe)), args(build_args(this->exe, std::move(args))), cmd_only(false) {}; template void on_setup(Executor& exec) const { if (cmd_only && args.empty()) exec.cmd_line = exe.c_str(); else { exec.exe = exe.c_str(); exec.cmd_line = args.c_str(); } } static exe_cmd_init exe_args(string_type && exe, std::vector && args) { return exe_cmd_init(std::move(exe), std::move(args)); } static exe_cmd_init cmd(string_type&& cmd) { return exe_cmd_init(std::move(cmd), true); } static exe_cmd_init exe_args_shell(string_type && exe, std::vector && args) { std::vector args_ = {c_arg(Char()), std::move(exe)}; args_.insert(args_.end(), std::make_move_iterator(args.begin()), std::make_move_iterator(args.end())); string_type sh = get_shell(Char()); return exe_cmd_init(std::move(sh), std::move(args_)); } static std:: string get_shell(char) {return shell(). string(codecvt()); } static std::wstring get_shell(wchar_t) {return shell().wstring(codecvt());} static exe_cmd_init cmd_shell(string_type&& cmd) { std::vector args = {c_arg(Char()), std::move(cmd)}; string_type sh = get_shell(Char()); return exe_cmd_init( std::move(sh), std::move(args)); } private: string_type exe; string_type args; bool cmd_only; }; } } } } #endif /* INCLUDE_BOOST_PROCESS_WINDOWS_ARGS_HPP_ */