mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-19 02:12:37 +01:00
Codechange: rework StringFilter to not need MallocT anymore
This commit is contained in:
@@ -76,7 +76,9 @@ inline size_t ttd_strnlen(const char *str, size_t maxlen)
|
||||
bool IsValidChar(char32_t key, CharSetFilter afilter);
|
||||
|
||||
size_t Utf8Decode(char32_t *c, const char *s);
|
||||
inline size_t Utf8Decode(char32_t *c, std::string::iterator &s) { return Utf8Decode(c, &*s); }
|
||||
/* std::string_view::iterator might be char *, in which case we do not want this templated variant to be taken. */
|
||||
template <typename T> requires (!std::is_same_v<T, char *> && (std::is_same_v<std::string_view::iterator, T> || std::is_same_v<std::string::iterator, T>))
|
||||
inline size_t Utf8Decode(char32_t *c, T &s) { return Utf8Decode(c, &*s); }
|
||||
size_t Utf8Encode(char *buf, char32_t c);
|
||||
size_t Utf8Encode(std::ostreambuf_iterator<char> &buf, char32_t c);
|
||||
size_t Utf8Encode(std::back_insert_iterator<std::string> &buf, char32_t c);
|
||||
|
||||
Reference in New Issue
Block a user