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:
authorArsentiy Milchakov <milcars@mapswithme.com>2017-10-20 17:15:30 +0300
committerr.kuznetsov <r.kuznetsov@corp.mail.ru>2017-11-09 11:10:09 +0300
commita7659720645179125fe96ff3afb11f8396430193 (patch)
treea9d0a231d671d3697caf629c6368f2683810521c /indexer/ftraits.hpp
parent8bcc2e1c5885e4348f9727881db7bb697d47dc24 (diff)
[ugc] ugc_types.csv is unified
Diffstat (limited to 'indexer/ftraits.hpp')
-rw-r--r--indexer/ftraits.hpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/indexer/ftraits.hpp b/indexer/ftraits.hpp
index 35ac7f3241..6a301c5a9f 100644
--- a/indexer/ftraits.hpp
+++ b/indexer/ftraits.hpp
@@ -110,7 +110,7 @@ class UGC : public TraitsBase<UGC, UGCItem>
ASSERT_EQUAL(row.size(), 5, ());
UGCItem item(ReadMasks(row), ParseByWhitespaces(row[kCategoriesPos]));
- auto typePath = ParseByWhitespaces(row[kTypePos]);
+ auto typePath = ParseByDashes(row[kTypePos]);
if (IsUGCAvailable(item.m_mask))
m_matcher.AppendType(std::move(typePath), std::move(item));
@@ -147,6 +147,16 @@ class UGC : public TraitsBase<UGC, UGCItem>
return {std::istream_iterator<std::string>(iss), std::istream_iterator<std::string>()};
}
+ std::vector<std::string> ParseByDashes(std::string const & str)
+ {
+ std::vector<std::string> result;
+ std::istringstream iss(str);
+ for (std::string tmp; std::getline(iss, tmp, '-'); )
+ result.push_back(tmp);
+
+ return result;
+ }
+
public:
static bool IsUGCAvailable(UGCTypeMask mask) { return mask != UGCTYPE_NONE; }
static bool IsRatingAvailable(UGCTypeMask mask) { return mask & UGCTYPE_RATING; }