Common: Add String::ToStdString()

This commit is contained in:
Stenzek 2023-09-12 23:42:46 +10:00
parent 2594e208cd
commit ec43b09a33
1 changed files with 4 additions and 0 deletions

View File

@ -249,6 +249,10 @@ public:
{ {
return IsEmpty() ? std::string_view() : std::string_view(GetCharArray(), GetLength()); return IsEmpty() ? std::string_view() : std::string_view(GetCharArray(), GetLength());
} }
std::string ToStdString() const
{
return std::string(GetStringView());
}
// creates a new string from the specified format // creates a new string from the specified format
static String FromFormat(const char* FormatString, ...) printflike(1, 2); static String FromFormat(const char* FormatString, ...) printflike(1, 2);