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

Method _load_buffer_UTF8

MyGUIEngine/src/MyGUI_UString.cpp:2003–2024  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2001 }
2002
2003 void UString::_load_buffer_UTF8() const
2004 {
2005 _getBufferStr();
2006 std::string& buffer = (*m_buffer.mStrBuffer);
2007 buffer.reserve(length());
2008
2009 unsigned char utf8buf[6];
2010 char* charbuf = (char*)utf8buf;
2011 unicode_char c;
2012 size_t len;
2013
2014 const_iterator i;
2015 const_iterator ie = end();
2016 for (i = begin(); i != ie; i.moveNext())
2017 {
2018 c = i.getCharacter();
2019 len = _utf32_to_utf8(c, utf8buf);
2020 size_t j = 0;
2021 while (j < len)
2022 buffer.push_back(charbuf[j++]);
2023 }
2024 }
2025
2026 void UString::_load_buffer_WStr() const
2027 {

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