From 129a22cfcc7651daa4b11ed52e7870249f6373a5 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Tue, 16 Sep 2014 10:23:14 +0100 Subject: spring cleaning --- fast/util.hh | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 fast/util.hh (limited to 'fast/util.hh') diff --git a/fast/util.hh b/fast/util.hh deleted file mode 100644 index 9ce19da..0000000 --- a/fast/util.hh +++ /dev/null @@ -1,47 +0,0 @@ -#pragma once - -#include - -#include "weaver.hh" - -using namespace std; - - -namespace util { - -inline string -json_escape(const string& s) -{ - ostringstream os; - for (auto it = s.cbegin(); it != s.cend(); it++) { - switch (*it) { - case '"': os << "\\\""; break; - case '\\': os << "\\\\"; break; - case '\b': os << "\\b"; break; - case '\f': os << "\\f"; break; - case '\n': os << "\\n"; break; - case '\r': os << "\\r"; break; - case '\t': os << "\\t"; break; - default: os << *it; break; - } - } - - return os.str(); -} - -inline vector -tokenize(string s) -{ - istringstream ss(s); - vector r; - while (ss.good()) { - string buf; - ss >> buf; - r.push_back(buf); - } - - return r; -} - -} // namespace util - -- cgit v1.2.3