diff options
| author | Czarek Nakamoto <cyjan@mrcyjanek.net> | 2024-01-04 22:17:42 +0100 |
|---|---|---|
| committer | Czarek Nakamoto <cyjan@mrcyjanek.net> | 2024-01-04 22:17:42 +0100 |
| commit | 12bc3aaaa9aafb7db0b08ad1343f830070aa18d3 (patch) | |
| tree | 605be942e089a30acc1d7e76a39645f921638473 /libbridge/src/main/cpp/helpers.cpp | |
| parent | 1e52f62e78918ae1805eddca435014d4f27e4ae8 (diff) | |
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.
Diffstat (limited to 'libbridge/src/main/cpp/helpers.cpp')
| -rw-r--r-- | libbridge/src/main/cpp/helpers.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
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<uint32_t>& intSet, const std::string s memcpy(buffer, str.c_str(), size + 1); return buffer; } + +std::set<std::string> splitString(const std::string& str, const std::string& delim) { + std::set<std::string> 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 |
