/
githubmirror
/
omim
Обзор
Документация
Войти
/
githubmirror
/
omim
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
storage/country_name_getter.cpp
43 строки
976 B
Maxim Pimenov
Got rid of the old style std/ includes for several files, mostly in map/ and platform/.
23 сен 2019, 13:25
23 сен 2019, 13:25
bfc0b02
Код
Авторство
О чём код?
#include "storage/country_name_getter.hpp" #include "base/assert.hpp" namespace storage { void CountryNameGetter::SetLocale(std::string const & locale) { m_getCurLang = platform::GetTextByIdFactory(platform::TextSource::Countries, locale); } void CountryNameGetter::SetLocaleForTesting(std::string const & jsonBuffer, std::string const & locale) { m_getCurLang = platform::ForTestingGetTextByIdFactory(jsonBuffer, locale); } std::string CountryNameGetter::Get(std::string const & key) const { ASSERT(!key.empty(), ()); if (m_getCurLang == nullptr) return std::string(); return (*m_getCurLang)(key); } std::string CountryNameGetter::operator()(CountryId const & countryId) const { std::string const name = Get(countryId); if (name.empty()) return countryId; return name; } std::string CountryNameGetter::GetLocale() const { if (m_getCurLang == nullptr) return std::string(); return m_getCurLang->GetLocale(); } } // namespace storage