aboutsummaryrefslogtreecommitdiff
path: root/src/StringUtils.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-11-18 23:32:08 +0100
committerdec05eba <dec05eba@protonmail.com>2022-11-18 23:32:12 +0100
commitde45f6d8d7d777244006a7998ec971157e51296e (patch)
tree93ab54b196bda4af7d7fe16d74fb25f08c37a931 /src/StringUtils.cpp
parentc56cb5d25388d938fce485ff02b067a2fd70e096 (diff)
Readd meme gpg encryption in matrix, this time asynchronous decryption
of only visible items
Diffstat (limited to 'src/StringUtils.cpp')
-rw-r--r--src/StringUtils.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/StringUtils.cpp b/src/StringUtils.cpp
index bc59730..564f307 100644
--- a/src/StringUtils.cpp
+++ b/src/StringUtils.cpp
@@ -3,7 +3,7 @@
namespace QuickMedia {
template <typename T>
- static void string_split_t(const std::string &str, const T &delimiter, StringSplitCallback callback_func, bool include_empty) {
+ static void string_split_t(const std::string_view str, const T &delimiter, StringSplitCallback callback_func, bool include_empty) {
size_t index = 0;
while(index < str.size()) {
size_t new_index = str.find(delimiter, index);
@@ -23,10 +23,18 @@ namespace QuickMedia {
}
void string_split(const std::string &str, const std::string &delimiter, StringSplitCallback callback_func, bool include_empty) {
- string_split_t(str, delimiter, callback_func, include_empty);
+ string_split_t(std::string_view(str), delimiter, callback_func, include_empty);
}
void string_split(const std::string &str, char delimiter, StringSplitCallback callback_func, bool include_empty) {
+ string_split_t(std::string_view(str), delimiter, callback_func, include_empty);
+ }
+
+ void string_split_view(const std::string_view str, const std::string &delimiter, StringSplitCallback callback_func, bool include_empty) {
+ string_split_t(str, delimiter, callback_func, include_empty);
+ }
+
+ void string_split_view(const std::string_view str, char delimiter, StringSplitCallback callback_func, bool include_empty) {
string_split_t(str, delimiter, callback_func, include_empty);
}