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:
authorAlex Zolotarev <alex@maps.me>2016-02-25 17:40:15 +0300
committerSergey Yershov <yershov@corp.mail.ru>2016-03-23 16:49:30 +0300
commit03d6b46db2c016443888116bffe0109e13d052e2 (patch)
tree41043b4b4df6c8ccdc9d01cfa73efe716e91ff78 /indexer/cuisines.hpp
parent2dd4c4c38a767507bd5f822df8233ce678a749a2 (diff)
Cuisines parsing and localization wrapper.
Diffstat (limited to 'indexer/cuisines.hpp')
-rw-r--r--indexer/cuisines.hpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/indexer/cuisines.hpp b/indexer/cuisines.hpp
new file mode 100644
index 0000000000..2d745e302c
--- /dev/null
+++ b/indexer/cuisines.hpp
@@ -0,0 +1,35 @@
+#pragma once
+
+#include "platform/get_text_by_id.hpp"
+#include "platform/preferred_languages.hpp"
+
+#include "std/string.hpp"
+#include "std/vector.hpp"
+
+namespace osm
+{
+using TAllCuisines = vector<pair<string, string>>;
+
+class Cuisines
+{
+ Cuisines() = default;
+
+public:
+ static Cuisines & Instance();
+ /// @param[out] outCuisines contains list of parsed cuisines (not localized).
+ void Parse(string const & osmRawCuisinesTagValue, vector<string> & outCuisines);
+ /// @param[in] lang should be in our twine strings.txt/cuisines.txt format.
+ /// @param[out] outCuisines contains list of parsed cuisines (localized).
+ void ParseAndLocalize(string const & osmRawCuisinesTagValue, vector<string> & outCuisines,
+ string const & lang = languages::GetCurrentTwine());
+ /// @param[in] lang should be in our twine strings.txt/cuisines.txt format.
+ /// @returns translated cuisine.
+ string Translate(string const & singleOsmCuisine,
+ string const & lang = languages::GetCurrentTwine());
+ /// @returns list of osm cuisines in cuisines.txt (not localized).
+ TAllCuisines AllSupportedCuisines();
+
+private:
+ platform::TGetTextByIdPtr m_translations;
+};
+} // namespace osm