#pragma once #include #include namespace QuickMedia { // Return false to stop iterating using StringSplitCallback = std::function; void string_split(const std::string &str, const std::string &delimiter, StringSplitCallback callback_func); void string_split(const std::string &str, char delimiter, StringSplitCallback callback_func); // Returns the number of replaced substrings size_t string_replace_all(std::string &str, char old_char, char new_char); // Returns the number of replaced substrings size_t string_replace_all(std::string &str, char old_char, const std::string &new_str); // Returns the number of replaced substrings size_t string_replace_all(std::string &str, const std::string &old_str, const std::string &new_str); std::string strip(const std::string &str); bool string_starts_with(const std::string &str, const char *sub); bool string_ends_with(const std::string &str, const std::string &ends_with_str); size_t str_find_case_insensitive(const std::string &str, size_t start_index, const char *substr, size_t substr_len); char to_upper(char c); bool strcase_equals(const char *str1, const char *str2); bool to_num(const char *str, size_t size, int &num); }