MCPcopy Create free account
hub / github.com/MyGUI/mygui / string as_utf8_impl

Method string as_utf8_impl

Tools/EditorFramework/pugixml.cpp:1661–1675  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1659
1660#ifndef PUGIXML_NO_STL
1661PUGI__FN std::string as_utf8_impl(const wchar_t* str, size_t length)
1662{
1663 // first pass: get length in utf8 characters
1664 size_t size = as_utf8_begin(str, length);
1665
1666 // allocate resulting string
1667 std::string result;
1668 result.resize(size);
1669
1670 // second pass: convert to utf8
1671 if (size > 0)
1672 as_utf8_end(&result[0], size, str, length);
1673
1674 return result;
1675}
1676
1677PUGI__FN std::basic_string<wchar_t> as_wide_impl(const char* str, size_t size)
1678{

Callers

nothing calls this directly

Calls 3

as_utf8_beginFunction · 0.70
as_utf8_endFunction · 0.70
resizeMethod · 0.45

Tested by

no test coverage detected