| 206 | } |
| 207 | |
| 208 | std::wstring StaticString::utf8ToWString(std::string_view str) { |
| 209 | static_assert(sizeof(wchar_t) == 2 || sizeof(wchar_t) == 4, "wchar_t must be 2 or 4 bytes"); |
| 210 | if constexpr (sizeof(wchar_t) == 2) { |
| 211 | auto pair = utf8ToUtf16(str.data(), str.size()); |
| 212 | return std::wstring(reinterpret_cast<const wchar_t*>(pair.first), pair.second); |
| 213 | } else { |
| 214 | auto pair = utf8ToUtf32(str.data(), str.size()); |
| 215 | return std::wstring(reinterpret_cast<const wchar_t*>(pair.first), pair.second); |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | std::ostream& operator<<(std::ostream& os, const StaticString& value) { |
| 220 | auto storage = value.utf8Storage(); |
nothing calls this directly
no test coverage detected