Ejemplo n.º 1
0
inline std::basic_ostream<Ch, Tr> & out_shell_quote(std::basic_ostream<Ch, Tr> &out, const C& data, bool quote_empty=true) {
  out_stream<Ch, Tr> chars(out);
  shell_quote_chars(chars, to_string(data), quote_empty);
  return out;
}
Ejemplo n.º 2
0
inline std::string shell_quote(const C& data, bool quote_empty=true) {
  string_builder b;
  return shell_quote_chars(append_string_builder(b), to_string(data), quote_empty).str();
}
Ejemplo n.º 3
0
inline std::string shell_quote(C const& data, bool quote_empty = true) {
  string_buffer b;  // NRVO in C++11
  shell_quote_chars(append_string_buffer(b), to_string(data), quote_empty);
  return strcopy(b);
}