diff --git a/desktop_version/src/UtilityClass.cpp b/desktop_version/src/UtilityClass.cpp index f6931bf8..c677a10b 100644 --- a/desktop_version/src/UtilityClass.cpp +++ b/desktop_version/src/UtilityClass.cpp @@ -230,3 +230,16 @@ bool is_positive_num(const std::string& str, bool hex) } return true; } + +bool endsWith(const std::string& str, const std::string& suffix) +{ + if (str.size() < suffix.size()) + { + return false; + } + return str.compare( + str.size() - suffix.size(), + suffix.size(), + suffix + ) == 0; +} diff --git a/desktop_version/src/UtilityClass.h b/desktop_version/src/UtilityClass.h index dcd6c6cd..fc88e1c7 100644 --- a/desktop_version/src/UtilityClass.h +++ b/desktop_version/src/UtilityClass.h @@ -13,6 +13,8 @@ std::vector split(const std::string &s, char delim); bool is_positive_num(const std::string& str, bool hex); +bool endsWith(const std::string& str, const std::string& suffix); + #define INBOUNDS(index, vector) ((int) index >= 0 && (int) index < (int) vector.size()) diff --git a/desktop_version/src/editor.cpp b/desktop_version/src/editor.cpp index 8140131e..7300c5d2 100644 --- a/desktop_version/src/editor.cpp +++ b/desktop_version/src/editor.cpp @@ -88,19 +88,6 @@ bool compare_nocase (std::string first, std::string second) return false; } -static bool endsWith(const std::string& str, const std::string& suffix) -{ - if (str.size() < suffix.size()) - { - return false; - } - return str.compare( - str.size() - suffix.size(), - suffix.size(), - suffix - ) == 0; -} - void editorclass::loadZips() { directoryList = FILESYSTEM_getLevelDirFileNames();