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

Method _load_buffer_WStr

MyGUIEngine/src/MyGUI_UString.cpp:2026–2047  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2024 }
2025
2026 void UString::_load_buffer_WStr() const
2027 {
2028 _getBufferWStr();
2029 std::wstring& buffer = (*m_buffer.mWStrBuffer);
2030 buffer.reserve(length()); // may over reserve, but should be close enough
2031#ifdef WCHAR_UTF16 // wchar_t matches UTF-16
2032 const_iterator i, ie = end();
2033 for (i = begin(); i != ie; ++i)
2034 {
2035 buffer.push_back((wchar_t)(*i));
2036 }
2037#else // wchar_t fits UTF-32
2038 unicode_char c;
2039 const_iterator i;
2040 const_iterator ie = end();
2041 for (i = begin(); i != ie; i.moveNext())
2042 {
2043 c = i.getCharacter();
2044 buffer.push_back((wchar_t)c);
2045 }
2046#endif
2047 }
2048
2049 void UString::_load_buffer_UTF32() const
2050 {

Callers

nothing calls this directly

Calls 5

moveNextMethod · 0.80
getCharacterMethod · 0.80
lengthFunction · 0.50
reserveMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected