|
2 | 2 | #include <LLUtils/StringUtility.h> |
3 | 3 | namespace FreeType |
4 | 4 | { |
5 | | - FormattedTextEntry FormattedTextEntry::Parse(const std::wstring& format, const std::wstring& text) |
| 5 | + FormattedTextEntry FormattedTextEntry::Parse(const string_type& format, const string_type& text) |
6 | 6 | { |
7 | 7 | using namespace std; |
8 | 8 | using namespace LLUtils; |
9 | 9 |
|
10 | 10 | using string_type = std::remove_const_t<std::remove_reference_t<decltype(text)>>; |
11 | 11 | FormattedTextEntry result {}; |
12 | 12 |
|
13 | | - wstring trimmed = StringUtility::ToLower(format); |
14 | | - trimmed.erase(trimmed.find_last_not_of(L" >") + 1); |
15 | | - trimmed.erase(0, trimmed.find_first_not_of(L" <")); |
16 | | - |
17 | | - |
| 13 | + string_type trimmed = StringUtility::ToLower(format); |
| 14 | + trimmed.erase(trimmed.find_last_not_of(LLUTILS_TEXT(" >")) + 1); |
| 15 | + trimmed.erase(0, trimmed.find_first_not_of(LLUTILS_TEXT(" <"))); |
18 | 16 |
|
19 | 17 | using stringList = ListString<string_type>; |
20 | 18 |
|
21 | 19 | bool isValid = false; |
22 | | - stringList properties = StringUtility::split(trimmed, L';'); |
| 20 | + stringList properties = StringUtility::split(trimmed, LLUTILS_TEXT(';')); |
23 | 21 | stringstream ss; |
24 | 22 | for (const string_type& prop : properties) |
25 | 23 | { |
26 | | - stringList trimmedList = StringUtility::split(prop, L'='); |
| 24 | + stringList trimmedList = StringUtility::split(prop, LLUTILS_TEXT('=')); |
27 | 25 |
|
28 | 26 | if (trimmedList.size() == 2) |
29 | 27 | { |
30 | 28 | const string_type key = StringUtility::ToLower(trimmedList[0]); |
31 | 29 | const string_type& value = trimmedList[1]; |
32 | | - if (key == L"textcolor") |
| 30 | + if (key == LLUTILS_TEXT("textcolor")) |
33 | 31 | { |
34 | 32 | result.textColor = Color::FromString(StringUtility::ToAString(value)); |
35 | 33 | } |
@@ -64,7 +62,7 @@ namespace FreeType |
64 | 62 |
|
65 | 63 |
|
66 | 64 |
|
67 | | - VecFormattedTextEntry MetaText::GetFormattedText(std::wstring text) |
| 65 | + VecFormattedTextEntry MetaText::GetFormattedText(string_type text) |
68 | 66 | { |
69 | 67 | using namespace std; |
70 | 68 | using string_type = decltype(text); |
|
0 commit comments