From f7ca0146ba7fed288c34040db0c2eae1683cf461 Mon Sep 17 00:00:00 2001 From: BossCode45 Date: Wed, 21 Dec 2022 17:25:20 +1300 Subject: Config file working - more tests and potentially features before merge with main though --- util.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 util.cpp (limited to 'util.cpp') 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 + +using std::string; + +std::vector split (const string &s, char delim) { + std::vector result; + std::stringstream ss (s); + string item; + + while (getline (ss, item, delim)) { + result.push_back (item); + } + + return result; +} -- cgit v1.2.3