21 #ifndef XAPIAN_INCLUDED_APPEND_FILENAME_ARG_H
22 #define XAPIAN_INCLUDED_APPEND_FILENAME_ARG_H
30 const std::string& arg,
31 bool leading_space =
true) {
33 cmd.reserve(cmd.size() + arg.size() + 5);
36 const char* prefix = (arg[0] ==
'-') ?
" \".\\" :
" \"";
47 }
else if (ch < 32 || std::strchr(
"<>\"|*?", ch)) {
59 cmd.reserve(cmd.size() + arg.size() + 5);
63 const char* prefix = (arg[0] ==
'-') ?
" './" :
" '";
static bool append_filename_argument(std::string &cmd, const std::string &arg, bool leading_space=true)
Append filename argument arg to command cmd with suitable escaping.