MCPcopy Create free account
hub / github.com/MyGUI/mygui / convert_path_heap

Function convert_path_heap

Tools/EditorFramework/pugixml.cpp:4047–4064  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4045}
4046#else
4047PUGI__FN char* convert_path_heap(const wchar_t* str)
4048{
4049 assert(str);
4050
4051 // first pass: get length in utf8 characters
4052 size_t length = wcslen(str);
4053 size_t size = as_utf8_begin(str, length);
4054
4055 // allocate resulting string
4056 char* result = static_cast<char*>(xml_memory::allocate(size + 1));
4057 if (!result)
4058 return 0;
4059
4060 // second pass: convert to utf8
4061 as_utf8_end(result, size, str, length);
4062
4063 return result;
4064}
4065
4066PUGI__FN FILE* open_file_wide(const wchar_t* path, const wchar_t* mode)
4067{

Callers 1

open_file_wideFunction · 0.70

Calls 2

as_utf8_beginFunction · 0.70
as_utf8_endFunction · 0.70

Tested by

no test coverage detected