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

Method GetString

libs/i18n/string_utf8_multilang.hpp:138–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136
137 template <typename String>
138 bool GetString(localisation::LanguageIndex const languageIndex, String & utf8s) const
139 {
140 if (!localisation::IsSupportedLanguageIndex(languageIndex))
141 return false;
142
143 size_t i = 0;
144 size_t const sz = m_s.size();
145
146 while (i < sz)
147 {
148 size_t const next = GetNextIndex(i);
149
150 if ((m_s[i] & kLangCodeMask) == languageIndex)
151 {
152 ++i;
153 utf8s = {m_s.c_str() + i, next - i};
154 return true;
155 }
156
157 i = next;
158 }
159
160 return false;
161 }
162 template <typename String>
163 bool GetString(localisation::LanguageCode const languageCode, String & utf8s) const
164 {

Callers 9

BestTranslationFunction · 0.45
LocalTranslationFunction · 0.45
TestMultilangStringFunction · 0.45
UNIT_TESTFunction · 0.45
SetDefaultNameIfEmptyMethod · 0.45
GetDefaultNameMethod · 0.45
GetNameMethod · 0.45
ExtractNameFunction · 0.45
LogDiffInJournalMethod · 0.45

Calls 4

IsSupportedLanguageIndexFunction · 0.85
GetStringFunction · 0.70
sizeMethod · 0.45

Tested by 2

TestMultilangStringFunction · 0.36
UNIT_TESTFunction · 0.36