util/AllocatedString: rename to BasicAllocatedString

To make things simpler, AllocatedString is now a non-template class.
This commit is contained in:
Max Kellermann
2021-01-14 12:39:45 +01:00
committed by Max Kellermann
parent 8d80280ab9
commit cfb7f8ab84
20 changed files with 73 additions and 64 deletions

View File

@@ -25,7 +25,7 @@
#include <windows.h>
AllocatedString<char>
AllocatedString
WideCharToMultiByte(unsigned code_page, std::wstring_view src)
{
int length = WideCharToMultiByte(code_page, 0, src.data(), src.size(),
@@ -42,10 +42,10 @@ WideCharToMultiByte(unsigned code_page, std::wstring_view src)
throw MakeLastError("Failed to convert from Unicode");
buffer[length] = '\0';
return AllocatedString<char>::Donate(buffer.release());
return AllocatedString::Donate(buffer.release());
}
AllocatedString<wchar_t>
BasicAllocatedString<wchar_t>
MultiByteToWideChar(unsigned code_page, std::string_view src)
{
int length = MultiByteToWideChar(code_page, 0, src.data(), src.size(),
@@ -60,5 +60,5 @@ MultiByteToWideChar(unsigned code_page, std::string_view src)
throw MakeLastError("Failed to convert to Unicode");
buffer[length] = L'\0';
return AllocatedString<wchar_t>::Donate(buffer.release());
return BasicAllocatedString<wchar_t>::Donate(buffer.release());
}