From a7659720645179125fe96ff3afb11f8396430193 Mon Sep 17 00:00:00 2001 From: Arsentiy Milchakov Date: Fri, 20 Oct 2017 17:15:30 +0300 Subject: [ugc] ugc_types.csv is unified --- indexer/ftraits.hpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'indexer/ftraits.hpp') 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 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 return {std::istream_iterator(iss), std::istream_iterator()}; } + std::vector ParseByDashes(std::string const & str) + { + std::vector 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; } -- cgit v1.2.3