| 18 | } |
| 19 | |
| 20 | inline std::wstring Utf8ToWideString(const std::string& str) |
| 21 | { |
| 22 | std::wstring ret; |
| 23 | const int length = MultiByteToWideChar( |
| 24 | CP_UTF8, |
| 25 | MB_ERR_INVALID_CHARS, |
| 26 | str.c_str(), |
| 27 | static_cast<int>(str.size()), |
| 28 | nullptr, |
| 29 | 0); |
| 30 | assert(length != 0 && "utf8 conversion to wide char mustn't fail!"); |
| 31 | ret.resize(length); |
| 32 | MultiByteToWideChar( |
| 33 | CP_UTF8, |
| 34 | MB_ERR_INVALID_CHARS, |
| 35 | str.c_str(), |
| 36 | static_cast<int>(str.size()), |
| 37 | ret.data(), |
| 38 | length); |
| 39 | return ret; |
| 40 | } |
| 41 | |
| 42 | inline bool IsDirectory(const wchar_t* path) |
| 43 | { |
nothing calls this directly
no outgoing calls
no test coverage detected