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

Function ExtractName

libs/indexer/editable_map_object.cpp:38–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36namespace
37{
38bool ExtractName(StringUtf8Multilang const & names, localisation::LanguageIndex const languageIndex, vector<osm::LocalizedName> & result)
39{
40 if (localisation::kUnsupportedLanguageIndex == languageIndex)
41 return false;
42
43 // Exclude languages that are already present.
44 auto const it = base::FindIf(
45 result, [languageIndex](osm::LocalizedName const & localizedName) { return localizedName.m_languageIndex == languageIndex; });
46
47 if (result.end() != it)
48 return false;
49
50 string_view name;
51 names.GetString(languageIndex, name);
52 result.emplace_back(languageIndex, std::string{name});
53
54 return true;
55}
56std::string GetCurrentDate()
57{
58 auto const t = std::time(nullptr);

Callers 1

GetNamesDataSourceMethod · 0.85

Calls 4

FindIfFunction · 0.50
endMethod · 0.45
GetStringMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected