Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Gorshenin <y@maps.me>2016-09-07 12:04:07 +0300
committerYuri Gorshenin <y@maps.me>2016-09-07 12:09:34 +0300
commite8a77fb0fbf27ba468a8b3f952efd0fb3743cabd (patch)
treec351e6fe6856798828dc06446cde5998cdbbf099 /indexer/categories_holder.hpp
parente34ff29fc192f5fe62e6a4ee21dd634277107c9a (diff)
[search][android][ios] Exposed categories synonyms.
Diffstat (limited to 'indexer/categories_holder.hpp')
-rw-r--r--indexer/categories_holder.hpp13
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);