diff options
| author | BossCode45 <human.cyborg42@gmail.com> | 2022-12-21 17:25:20 +1300 |
|---|---|---|
| committer | BossCode45 <human.cyborg42@gmail.com> | 2022-12-21 17:25:20 +1300 |
| commit | f7ca0146ba7fed288c34040db0c2eae1683cf461 (patch) | |
| tree | 76c7bc201dd12d1ae44deaded822d6cb0f78b91c /util.cpp | |
| parent | b116028a645d7db75d93c359462112ac4ad8d5ad (diff) | |
| download | YATwm-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.cpp | 17 |
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; +} |
