| 34 | #include <windows.h> |
| 35 | |
| 36 | std::wstring WideFromUtf8(const std::string& text) { |
| 37 | if (text.empty()) { |
| 38 | return L""; |
| 39 | } |
| 40 | const int size = |
| 41 | MultiByteToWideChar(CP_UTF8, 0, text.c_str(), -1, nullptr, 0); |
| 42 | if (size <= 1) { |
| 43 | return L""; |
| 44 | } |
| 45 | std::wstring wide(static_cast<size_t>(size), L'\0'); |
| 46 | MultiByteToWideChar(CP_UTF8, 0, text.c_str(), -1, &wide[0], size); |
| 47 | wide.resize(static_cast<size_t>(size - 1)); |
| 48 | return wide; |
| 49 | } |
| 50 | |
| 51 | void CopyRegularFiles(const std::filesystem::path& sourceDir, |
| 52 | const std::filesystem::path& targetDir) { |
no test coverage detected