void operator()(FeatureType & f, uint32_t) { ++m_totalCount; string s1, s2; f.GetPreferredNames(s1, s2); if (!s1.empty()) ++m_namesCount; m_currFeatureTypes.clear(); f.ForEachType([this](uint32_t type) { m_currFeatureTypes.push_back(type); }); CHECK(!m_currFeatureTypes.empty(), ("Feature without any type???")); auto found = m_stats.insert(make_pair(m_currFeatureTypes, 1)); if (!found.second) found.first->second++; }
void CaptionDescription::Init(FeatureType & f, int8_t deviceLang, int const zoomLevel, feature::EGeomType const type, drule::text_type_t const mainTextType, bool const auxCaptionExists) { if (auxCaptionExists || type == feature::GEOM_LINE) f.GetPreferredNames(true /* allowTranslit */, deviceLang, m_mainText, m_auxText); else f.GetReadableName(true /* allowTranslit */, deviceLang, m_mainText); // Set max text size to avoid VB/IB overflow in rendering. size_t constexpr kMaxTextSize = 200; if (m_mainText.size() > kMaxTextSize) m_mainText = m_mainText.substr(0, kMaxTextSize) + "..."; m_roadNumber = f.GetRoadNumber(); m_houseNumber = f.GetHouseNumber(); ProcessZoomLevel(zoomLevel); ProcessMainTextType(mainTextType); }