MCPcopy Create free account
hub / github.com/comaps/comaps / AddString

Method AddString

libs/i18n/string_utf8_multilang.cpp:59–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59void StringUtf8Multilang::AddString(localisation::LanguageIndex const languageIndex, std::string_view utf8s)
60{
61 size_t i = 0;
62 size_t const sz = m_s.size();
63
64 while (i < sz)
65 {
66 size_t const next = GetNextIndex(i);
67
68 if ((m_s[i] & kLangCodeMask) == languageIndex)
69 {
70 ++i;
71 m_s.replace(i, next - i, utf8s);
72 return;
73 }
74
75 i = next;
76 }
77
78 m_s.push_back(languageIndex | 0x80);
79 m_s.insert(m_s.end(), utf8s.begin(), utf8s.end());
80}
81
82void StringUtf8Multilang::RemoveString(localisation::LanguageIndex const languageIndex)
83{

Callers 2

TestMultilangStringFunction · 0.45
UNIT_TESTFunction · 0.45

Calls 5

sizeMethod · 0.45
push_backMethod · 0.45
insertMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by 2

TestMultilangStringFunction · 0.36
UNIT_TESTFunction · 0.36