| 25 | #include <SDL3/SDL_iostream.h> |
| 26 | |
| 27 | std::vector<std::string> split_string_by_token(std::string str, std::string token) { |
| 28 | // slightly modified from: https://stackoverflow.com/a/46943631 |
| 29 | std::vector<std::string> toRet; |
| 30 | while(!str.empty()) { |
| 31 | size_t index = str.find(token); |
| 32 | if(index != std::string::npos) { |
| 33 | toRet.emplace_back(str.substr(0, index)); |
| 34 | str = str.substr(index + token.size()); |
| 35 | if(str.empty()) |
| 36 | toRet.emplace_back(str); |
| 37 | } |
| 38 | else { |
| 39 | toRet.emplace_back(str); |
| 40 | return toRet; |
| 41 | } |
| 42 | } |
| 43 | return toRet; |
| 44 | } |
| 45 | |
| 46 | uint8_t ascii_hex_char_to_number_no_checks(char asciiHex) { |
| 47 | if(asciiHex <= '9') |
no test coverage detected