diff options
author | Yuri Gorshenin <y@maps.me> | 2016-09-07 12:04:07 +0300 |
---|---|---|
committer | Yuri Gorshenin <y@maps.me> | 2016-09-07 12:09:34 +0300 |
commit | e8a77fb0fbf27ba468a8b3f952efd0fb3743cabd (patch) | |
tree | c351e6fe6856798828dc06446cde5998cdbbf099 /indexer/categories_holder.hpp | |
parent | e34ff29fc192f5fe62e6a4ee21dd634277107c9a (diff) |
[search][android][ios] Exposed categories synonyms.
Diffstat (limited to 'indexer/categories_holder.hpp')
-rw-r--r-- | indexer/categories_holder.hpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/indexer/categories_holder.hpp b/indexer/categories_holder.hpp index b488e4ab5d..3719fd7fbc 100644 --- a/indexer/categories_holder.hpp +++ b/indexer/categories_holder.hpp @@ -41,6 +41,8 @@ public: int8_t m_code; }; + using GroupTranslations = unordered_map<string, vector<Category::Name>>; + private: typedef strings::UniString StringT; typedef multimap<uint32_t, shared_ptr<Category> > Type2CategoryContT; @@ -49,6 +51,7 @@ private: Type2CategoryContT m_type2cat; Name2CatContT m_name2type; + GroupTranslations m_groupTranslations; public: static int8_t const kEnglishCode; @@ -107,6 +110,8 @@ public: } } + inline GroupTranslations const & GetGroupTranslations() const { return m_groupTranslations; } + /// Search name for type with preffered locale language. /// If no name for this language, return first (en) name. /// @return false if no categories for type. @@ -123,9 +128,15 @@ public: m_name2type.swap(r.m_name2type); } - /// Converts any language locale from UI to internal integer code + // Converts any language |locale| from UI to the corresponding + // internal integer code static int8_t MapLocaleToInteger(string const & locale); + // Returns corresponding string representation for an internal + // integer |code|. Returns an empty string in case of invalid + // |code|. + static string MapIntegerToLocale(int8_t code); + private: void AddCategory(Category & cat, vector<uint32_t> & types); static bool ValidKeyToken(StringT const & s); |