/
ne1ghost
/
nix
Обзор
Документация
Войти
/
ne1ghost
/
nix
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/libutil/windows/os-string.cc
24 строки
580 B
John Ericson
Factor out `lookupExecutable` and other PATH improvments
08 авг 2024, 01:12
08 авг 2024, 01:12
6c861b9
Код
Авторство
О чём код?
#include <algorithm> #include <codecvt> #include <iostream> #include <locale> #include "file-path.hh" #include "file-path-impl.hh" #include "util.hh" namespace nix { std::string os_string_to_string(PathViewNG::string_view path) { std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter; return converter.to_bytes(std::filesystem::path::string_type{path}); } std::filesystem::path::string_type string_to_os_string(std::string_view s) { std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter; return converter.from_bytes(std::string{s}); } }