From 56acc142c6ef9a65147acdea6737acbfaeb7eca4 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 15 Oct 2019 19:57:24 +0200 Subject: Add tor support --- src/StringUtils.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/StringUtils.cpp (limited to 'src/StringUtils.cpp') 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 -- cgit v1.2.3