From 12bc3aaaa9aafb7db0b08ad1343f830070aa18d3 Mon Sep 17 00:00:00 2001 From: Czarek Nakamoto Date: Thu, 4 Jan 2024 22:17:42 +0100 Subject: drop cache, it is causing more trouble than it's worth implement anonero's fork functions in bridge. Calling it RC39 to not break versioning. --- libbridge/src/main/cpp/helpers.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libbridge/src/main/cpp/helpers.cpp') diff --git a/libbridge/src/main/cpp/helpers.cpp b/libbridge/src/main/cpp/helpers.cpp index 064ce36..fac131a 100644 --- a/libbridge/src/main/cpp/helpers.cpp +++ b/libbridge/src/main/cpp/helpers.cpp @@ -143,3 +143,17 @@ const char* vectorToString(const std::set& intSet, const std::string s memcpy(buffer, str.c_str(), size + 1); return buffer; } + +std::set splitString(const std::string& str, const std::string& delim) { + std::set tokens; + size_t pos = 0; + std::string token; + std::string content = str; // Copy of str so we can safely erase content + while ((pos = content.find(delim)) != std::string::npos) { + token = content.substr(0, pos); + tokens.insert(token); + content.erase(0, pos + delim.length()); + } + tokens.insert(content); // Inserting the last token + return tokens; +} \ No newline at end of file -- cgit v1.2.3