| 4 | #include <Windows.h> |
| 5 | |
| 6 | class StringHelper |
| 7 | { |
| 8 | public: |
| 9 | StringHelper() = default; |
| 10 | ~StringHelper() = default; |
| 11 | |
| 12 | static std::string ReplaceAll(const std::string& str, const std::string& search, const std::string& replace); |
| 13 | static std::wstring ReplaceAll(const std::wstring& wstr, const std::wstring& search, const std::wstring& replace); |
| 14 | |
| 15 | static std::string ReplaceLiteral(const std::string& str, const std::string& search, const std::string& replace); |
| 16 | static std::wstring ReplaceLiteral(const std::wstring& wstr, const std::wstring& search, const std::wstring& replace); |
| 17 | |
| 18 | static std::wstring ToWstring(const std::string& str, UINT codePage = CP_THREAD_ACP); |
| 19 | static std::string ToString(const std::wstring& wstr, UINT codePage = CP_THREAD_ACP); |
| 20 | |
| 21 | static std::vector<std::string> Split(const std::string& input, const std::string& delim); |
| 22 | static std::vector<std::wstring> Split(const std::wstring& input, const std::wstring& delim); |
| 23 | |
| 24 | static bool Contains(const std::string& input, const std::string& search, bool ignoreCase = true); |
| 25 | static bool Contains(const std::wstring& input, const std::wstring& search, bool ignoreCase = true); |
| 26 | |
| 27 | static void ToLower(std::string& input); |
| 28 | static void ToLower(std::wstring& input); |
| 29 | |
| 30 | private: |
| 31 | static std::string EscapeRegex(const std::string& str); |
| 32 | static std::wstring EscapeRegex(const std::wstring& wstr); |
| 33 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected