summaryrefslogtreecommitdiff
path: root/util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'util.cpp')
-rw-r--r--util.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/util.cpp b/util.cpp
new file mode 100644
index 0000000..dff3428
--- /dev/null
+++ b/util.cpp
@@ -0,0 +1,17 @@
+#include "util.h"
+
+#include <sstream>
+
+using std::string;
+
+std::vector<string> split (const string &s, char delim) {
+ std::vector<string> result;
+ std::stringstream ss (s);
+ string item;
+
+ while (getline (ss, item, delim)) {
+ result.push_back (item);
+ }
+
+ return result;
+}