summaryrefslogtreecommitdiff
path: root/fast/util.hh
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2014-09-16 10:23:14 +0100
committerPatrick Simianer <p@simianer.de>2014-09-16 10:23:14 +0100
commit129a22cfcc7651daa4b11ed52e7870249f6373a5 (patch)
tree78de4649396ab0d37a325b7598f9873c2d65f4c9 /fast/util.hh
parentdf70006a07fb67b17fb39aa56762c50c2e7b8131 (diff)
spring cleaning
Diffstat (limited to 'fast/util.hh')
-rw-r--r--fast/util.hh47
1 files changed, 0 insertions, 47 deletions
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 <string>
-
-#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<symbol_t>
-tokenize(string s)
-{
- istringstream ss(s);
- vector<symbol_t> r;
- while (ss.good()) {
- string buf;
- ss >> buf;
- r.push_back(buf);
- }
-
- return r;
-}
-
-} // namespace util
-