Split Generic Text (#1)

* split generic text

* Add splited table, change split flag to `__split__`

* add split flag check

* fix target
This commit is contained in:
chinosk
2024-07-29 05:32:37 -05:00
committed by GitHub
parent 6ddf4212d4
commit 0e1ad6959b
2 changed files with 235 additions and 21 deletions
@@ -1471,6 +1471,25 @@ public:
}
}
[[nodiscard]] auto ToWString() const -> std::u16string {
#if WINDOWS_MODE
if (IsBadReadPtr(this, sizeof(String))) return {};
if (IsBadReadPtr(m_firstChar, m_stringLength)) return {};
#endif
if (!this) return {};
try {
// using convert_typeX = std::codecvt_utf8<wchar_t>;
// std::wstring_convert<convert_typeX> converterX;
// return converterX.to_bytes(m_firstChar);
return {chars};
}
catch (std::exception& e) {
std::cout << "String Invoke Error\n";
GakumasLocal::Log::ErrorFmt("String Invoke Error: %s", e.what());
return {};
}
}
auto operator=(const std::string& newString) const -> String* { return New(newString); }
auto operator==(const std::wstring& newString) const -> bool { return Equals(newString); }