aboutsummaryrefslogtreecommitdiff
path: root/src/StringUtils.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-10-15 19:57:24 +0200
committerdec05eba <dec05eba@protonmail.com>2019-10-15 19:57:27 +0200
commit56acc142c6ef9a65147acdea6737acbfaeb7eca4 (patch)
tree1b9a955bec7ed74c16e3cf663b9acca5aef8c19e /src/StringUtils.cpp
parent2ba21aa9aa91b975fe0c8be630dde05d0d9b5366 (diff)
Add tor support
Diffstat (limited to 'src/StringUtils.cpp')
-rw-r--r--src/StringUtils.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/StringUtils.cpp b/src/StringUtils.cpp
new file mode 100644
index 0000000..deb4949
--- /dev/null
+++ b/src/StringUtils.cpp
@@ -0,0 +1,17 @@
+#include "../include/StringUtils.hpp"
+
+namespace QuickMedia {
+ void string_split(const std::string &str, char delimiter, StringSplitCallback callback_func) {
+ size_t index = 0;
+ while(true) {
+ size_t new_index = str.find(delimiter, index);
+ if(new_index == std::string::npos)
+ break;
+
+ if(!callback_func(str.data() + index, new_index - index))
+ break;
+
+ index = new_index + 1;
+ }
+ }
+} \ No newline at end of file