14#include <sys/utsname.h>
32 return ::fopen(
p.c_str(), mode);
34 std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>,
wchar_t>
utf8_cvt;
35 return ::_wfopen(
p.wstring().c_str(),
utf8_cvt.from_bytes(mode).c_str());
40 assert(base.is_absolute());
41 return path.empty() ? base :
fs::path(base / path);
66 std::string(
uname_data.version).find(
"Microsoft") !=
105 reinterpret_cast<WCHAR *
>(&
err), 0,
nullptr);
108 return std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>>().
to_bytes(
133 0, std::numeric_limits<DWORD>::max(),
134 std::numeric_limits<DWORD>::max(), &
overlapped)) {
155 return std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>,
wchar_t>()
162 return fs::temp_directory_path();
168 std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>>().
to_bytes(
Path class wrapper to block calls to the fs::path(std::string) implicit constructor and the fs::path:...
static path PathFromString(const std::string &string)
Convert byte string to path object.
Bridge operations to C stdio.
fs::path GetTempDirectoryPath()
FILE * fopen(const fs::path &p, const char *mode)
std::string get_filesystem_error_message(const fs::filesystem_error &e)
fs::path AbsPathJoin(const fs::path &base, const fs::path &path)
Helper function for joining two paths.
static std::string GetErrorReason()
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
std::string SysErrorString(int err)
Return system error string from errno value.