5#ifndef RUNTIME_BIN_UTILS_WIN_H_
6#define RUNTIME_BIN_UTILS_WIN_H_
15#define MAX_LONG_PATH 32767
34 intptr_t* result_len =
nullptr);
37 intptr_t* result_len =
nullptr);
40 intptr_t* result_len =
nullptr);
43 intptr_t* result_len =
nullptr);
46 DISALLOW_ALLOCATION();
56 : utf8_(
Utils::CreateCStringUniquePtr(nullptr)) {
58 WideCharToMultiByte(CP_UTF8, 0, wide, -1,
nullptr, 0,
nullptr,
nullptr);
59 char*
utf8 =
reinterpret_cast<char*
>(
malloc(utf8_len));
60 WideCharToMultiByte(CP_UTF8, 0, wide, -1,
utf8, utf8_len,
nullptr,
nullptr);
65 char*
utf8()
const {
return utf8_.get(); }
66 intptr_t
length()
const {
return length_; }
75 DISALLOW_ALLOCATION();
static CStringUniquePtr CreateCStringUniquePtr(char *str)
std::unique_ptr< char, decltype(std::free) * > CStringUniquePtr
static const wchar_t * Utf8ToWide(const char *utf8, intptr_t len=-1, intptr_t *result_len=nullptr)
static const char * WideToUtf8(const wchar_t *wide, intptr_t len=-1, intptr_t *result_len=nullptr)
static char * WideToUtf8(wchar_t *wide, intptr_t len=-1, intptr_t *result_len=nullptr)
static wchar_t * Utf8ToWide(char *utf8, intptr_t len=-1, intptr_t *result_len=nullptr)
Utils::CStringUniquePtr release()
WideToUtf8Scope(const wchar_t *wide)
static const uint8_t buffer[]
std::unique_ptr< wchar_t[]> Utf8ToWideChar(const char *path)
FILETIME GetFiletimeFromMillis(int64_t millis)
void FormatMessageIntoBuffer(DWORD code, wchar_t *buffer, int buffer_length)
void * malloc(size_t size)
struct _FILETIME FILETIME