mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 12:19:12 +00:00
Kill AsciiToHex
Now superseded by Common::FromChars
This commit is contained in:
parent
5029924ba1
commit
445bf8d2c6
4 changed files with 36 additions and 32 deletions
|
@ -90,7 +90,8 @@ bool IsTitlePath(const std::string& path, std::optional<FromWhichRoot> from, u64
|
|||
}
|
||||
|
||||
u32 title_id_high, title_id_low;
|
||||
if (!AsciiToHex(components[0], title_id_high) || !AsciiToHex(components[1], title_id_low))
|
||||
if (Common::FromChars(components[0], title_id_high, 16).ec != std::errc{} ||
|
||||
Common::FromChars(components[1], title_id_low, 16).ec != std::errc{})
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -155,8 +156,11 @@ std::string UnescapeFileName(const std::string& filename)
|
|||
{
|
||||
u32 character;
|
||||
if (pos + 6 <= result.size() && result[pos + 4] == '_' && result[pos + 5] == '_')
|
||||
if (AsciiToHex(result.substr(pos + 2, 2), character))
|
||||
if (Common::FromChars(std::string_view{result}.substr(pos + 2, 2), character, 16).ec ==
|
||||
std::errc{})
|
||||
{
|
||||
result.replace(pos, 6, {static_cast<char>(character)});
|
||||
}
|
||||
|
||||
++pos;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue