Add more documentation.

This commit is contained in:
ArthurSonzogni
2020-08-16 02:24:50 +02:00
committed by Arthur Sonzogni
parent f2dc080a35
commit 114ab4ae2a
33 changed files with 310 additions and 144 deletions

View File

@@ -9,11 +9,13 @@ namespace ftxui {
#pragma warning(disable : 4996) // codecvt_utf8_utf16 is deprecated
#endif
/// Convert a UTF8 std::string into a std::wstring.
std::string to_string(const std::wstring& s) {
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
return converter.to_bytes(s);
}
/// Convert a std::wstring into a UTF8 std::string.
std::wstring to_wstring(const std::string& s) {
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
return converter.from_bytes(s);