mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/ChatCommands: Add std::wstring argument type (#25302)
(cherry picked from commit 617a769d6f)
This commit is contained in:
committed by
Shauren
parent
e9209c3131
commit
b527a031b9
@@ -120,6 +120,25 @@ struct ArgInfo<std::string, void>
|
||||
}
|
||||
};
|
||||
|
||||
// wstring
|
||||
template <>
|
||||
struct ArgInfo<std::wstring, void>
|
||||
{
|
||||
static char const* TryConsume(std::wstring& val, char const* args)
|
||||
{
|
||||
std::string utf8Str;
|
||||
char const* ret = ArgInfo<std::string>::TryConsume(utf8Str, args);
|
||||
|
||||
if (!ret)
|
||||
return nullptr;
|
||||
|
||||
if (!Utf8toWStr(utf8Str, val))
|
||||
return nullptr;
|
||||
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
|
||||
// enum
|
||||
template <typename T>
|
||||
struct ArgInfo<T, std::enable_if_t<std::is_enum_v<T>>>
|
||||
|
||||
Reference in New Issue
Block a user