summaryrefslogtreecommitdiff
path: root/util.cpp
diff options
context:
space:
mode:
authorBossCode45 <human.cyborg42@gmail.com>2022-12-21 17:25:20 +1300
committerBossCode45 <human.cyborg42@gmail.com>2022-12-21 17:25:20 +1300
commitf7ca0146ba7fed288c34040db0c2eae1683cf461 (patch)
tree76c7bc201dd12d1ae44deaded822d6cb0f78b91c /util.cpp
parentb116028a645d7db75d93c359462112ac4ad8d5ad (diff)
downloadYATwm-f7ca0146ba7fed288c34040db0c2eae1683cf461.tar.gz
YATwm-f7ca0146ba7fed288c34040db0c2eae1683cf461.zip
Config file working - more tests and potentially features before merge with main though
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;
+}