vendor/tomotopy/src/Utils/text.hpp in tomoto-0.1.4 vs vendor/tomotopy/src/Utils/text.hpp in tomoto-0.2.0
- old
+ new
@@ -2,10 +2,11 @@
#include <vector>
#include <string>
#include <iostream>
#include <iterator>
+#include <iomanip>
#include <algorithm>
#include <cstdio>
namespace tomoto
{
@@ -27,9 +28,16 @@
std::ostringstream stream;
std::copy(first, last, std::ostream_iterator<_Target>(stream, delimiter.c_str()));
std::string s = stream.str();
s.erase(s.end() - delimiter.size(), s.end());
return s;
+ }
+
+ inline std::string quote(const std::string& s)
+ {
+ std::ostringstream stream;
+ stream << std::quoted(s);
+ return stream.str();
}
inline std::vector<std::string> split(const std::string& str, const std::string& delim)
{
std::vector<std::string> tokens;
\ No newline at end of file