mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 20:35:36 +00:00
refactor: use std::string in tr_info (#2384)
This commit is contained in:
@@ -164,13 +164,6 @@ std::optional<T> tr_parseNum(std::string_view& sv)
|
||||
|
||||
#endif // #if defined(__GNUC__) && !__has_include(<charconv>)
|
||||
|
||||
/**
|
||||
* @brief make a copy of 'str' whose non-utf8 content has been corrected or stripped
|
||||
* @return a newly-allocated string that must be freed with tr_free()
|
||||
* @param str the string to make a clean copy of
|
||||
*/
|
||||
char* tr_utf8clean(std::string_view str) TR_GNUC_MALLOC;
|
||||
|
||||
bool tr_utf8_validate(std::string_view sv, char const** endptr);
|
||||
|
||||
#ifdef _WIN32
|
||||
@@ -300,6 +293,14 @@ std::string tr_strlower(T in)
|
||||
return out;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
std::string tr_strupper(T in)
|
||||
{
|
||||
auto out = std::string{ in };
|
||||
std::for_each(std::begin(out), std::end(out), [](char& ch) { ch = std::toupper(ch); });
|
||||
return out;
|
||||
}
|
||||
|
||||
/***
|
||||
**** std::string_view utils
|
||||
***/
|
||||
|
||||
Reference in New Issue
Block a user