diff --git a/indexer/indexer.pro b/indexer/indexer.pro index e0a6ee2958..b004421c32 100644 --- a/indexer/indexer.pro +++ b/indexer/indexer.pro @@ -100,10 +100,10 @@ HEADERS += \ scales.hpp \ search_delimiters.hpp \ search_index_builder.hpp \ + search_index_values.hpp \ search_string_utils.hpp \ search_trie.hpp \ string_file.hpp \ - string_file_values.hpp \ succinct_trie.hpp \ succinct_trie_builder.hpp \ succinct_trie_reader.hpp \ diff --git a/indexer/indexer_tests/trie_test.cpp b/indexer/indexer_tests/trie_test.cpp index 02af0c87aa..522016da9c 100644 --- a/indexer/indexer_tests/trie_test.cpp +++ b/indexer/indexer_tests/trie_test.cpp @@ -13,6 +13,7 @@ #include "std/algorithm.hpp" #include "std/cstring.hpp" #include "std/string.hpp" +#include "std/utility.hpp" #include "std/vector.hpp" #include @@ -37,65 +38,8 @@ struct ChildNodeInfo uint32_t GetEdgeSize() const { return m_edge.size(); } }; -struct KeyValuePair -{ - buffer_vector m_key; - uint32_t m_value; - - KeyValuePair() {} - - template - KeyValuePair(TString const & key, int value) - : m_key(key.begin(), key.end()), m_value(value) - { - } - - uint32_t GetKeySize() const { return m_key.size(); } - trie::TrieChar const * GetKeyData() const { return m_key.data(); } - uint32_t GetValue() const { return m_value; } - - inline void const * value_data() const { return &m_value; } - - inline size_t value_size() const { return sizeof(m_value); } - - bool operator==(KeyValuePair const & p) const - { - return (m_key == p.m_key && m_value == p.m_value); - } - - bool operator<(KeyValuePair const & p) const - { - return ((m_key != p.m_key) ? m_key < p.m_key : m_value < p.m_value); - } - - void Swap(KeyValuePair & r) - { - m_key.swap(r.m_key); - swap(m_value, r.m_value); - } -}; - -string DebugPrint(KeyValuePair const & p) -{ - string keyS = ::DebugPrint(p.m_key); - ostringstream out; - out << "KVP(" << keyS << ", " << p.m_value << ")"; - return out.str(); -} - -struct KeyValuePairBackInserter -{ - template - void operator()(TString const & s, uint32_t const & value) - { - m_v.push_back(KeyValuePair(s, value)); - } - - vector m_v; -}; - // The SingleValueSerializer and ValueList classes are similar to -// those in indexer/string_file_values.hpp. +// those in indexer/search_index_values.hpp. template class SingleValueSerializer { @@ -229,33 +173,48 @@ UNIT_TEST(TrieBuilder_Build) int const count = static_cast(possibleStrings.size()); for (int i0 = -1; i0 < count; ++i0) + { for (int i1 = i0; i1 < count; ++i1) + { for (int i2 = i1; i2 < count; ++i2) { - vector v; + using TKey = buffer_vector; + using TValue = uint32_t; + using TKeyValuePair = pair; + + vector v; + auto makeKey = [](string const & s) + { + return TKey(s.begin(), s.end()); + }; if (i0 >= 0) - v.push_back(KeyValuePair(possibleStrings[i0], i0)); + v.emplace_back(makeKey(possibleStrings[i0]), i0); if (i1 >= 0) - v.push_back(KeyValuePair(possibleStrings[i1], i1 + 10)); + v.emplace_back(makeKey(possibleStrings[i1]), i1 + 10); if (i2 >= 0) - v.push_back(KeyValuePair(possibleStrings[i2], i2 + 100)); + v.emplace_back(makeKey(possibleStrings[i2]), i2 + 100); vector vs; for (size_t i = 0; i < v.size(); ++i) - vs.push_back(string(v[i].m_key.begin(), v[i].m_key.end())); + vs.push_back(string(v[i].first.begin(), v[i].first.end())); vector buf; PushBackByteSink> sink(buf); SingleValueSerializer serializer; - trie::Build>, typename vector::iterator, - ValueList>(sink, serializer, v.begin(), v.end()); + trie::Build>, TKey, ValueList, + SingleValueSerializer>(sink, serializer, v); reverse(buf.begin(), buf.end()); MemReader memReader = MemReader(&buf[0], buf.size()); auto const root = trie::ReadTrie>(memReader, serializer); - vector res; - KeyValuePairBackInserter f; - trie::ForEachRef(*root, f, vector()); - sort(f.m_v.begin(), f.m_v.end()); - TEST_EQUAL(v, f.m_v, ()); + vector res; + auto addKeyValuePair = [&res](TKey const & k, TValue const & v) + { + res.emplace_back(k, v); + }; + trie::ForEachRef(*root, addKeyValuePair, TKey()); + sort(res.begin(), res.end()); + TEST_EQUAL(v, res, ()); } + } + } } diff --git a/indexer/search_index_builder.cpp b/indexer/search_index_builder.cpp index 491df9519b..e7bf5e0ee3 100644 --- a/indexer/search_index_builder.cpp +++ b/indexer/search_index_builder.cpp @@ -7,10 +7,9 @@ #include "indexer/feature_visibility.hpp" #include "indexer/features_vector.hpp" #include "indexer/search_delimiters.hpp" +#include "indexer/search_index_values.hpp" #include "indexer/search_string_utils.hpp" #include "indexer/search_trie.hpp" -#include "indexer/string_file.hpp" -#include "indexer/string_file_values.hpp" #include "indexer/trie_builder.hpp" #include "indexer/types_skipper.hpp" @@ -92,21 +91,26 @@ public: } }; -template +template struct FeatureNameInserter { SynonymsHolder * m_synonyms; - TStringsFile & m_names; - typename TStringsFile::ValueT m_val; + vector> & m_keyValuePairs; + TValue m_val; - FeatureNameInserter(SynonymsHolder * synonyms, TStringsFile & names) - : m_synonyms(synonyms), m_names(names) + FeatureNameInserter(SynonymsHolder * synonyms, vector> & keyValuePairs) + : m_synonyms(synonyms), m_keyValuePairs(keyValuePairs) { } void AddToken(signed char lang, strings::UniString const & s) const { - m_names.AddString(typename TStringsFile::TString(s, lang, m_val)); + strings::UniString key; + key.reserve(s.size() + 1); + key.push_back(static_cast(lang)); + key.append(s.begin(), s.end()); + + m_keyValuePairs.emplace_back(key, m_val); } private: @@ -151,7 +155,7 @@ public: } }; -template +template struct ValueBuilder; template <> @@ -182,26 +186,24 @@ struct ValueBuilder } }; -template +template class FeatureInserter { SynonymsHolder * m_synonyms; - TStringsFile & m_names; + vector> & m_keyValuePairs; CategoriesHolder const & m_categories; - using ValueT = typename TStringsFile::ValueT; - pair m_scales; - ValueBuilder const & m_valueBuilder; + ValueBuilder const & m_valueBuilder; public: - FeatureInserter(SynonymsHolder * synonyms, TStringsFile & names, + FeatureInserter(SynonymsHolder * synonyms, vector> & keyValuePairs, CategoriesHolder const & catHolder, pair const & scales, - ValueBuilder const & valueBuilder) + ValueBuilder const & valueBuilder) : m_synonyms(synonyms) - , m_names(names) + , m_keyValuePairs(keyValuePairs) , m_categories(catHolder) , m_scales(scales) , m_valueBuilder(valueBuilder) @@ -220,8 +222,8 @@ public: // Init inserter with serialized value. // Insert synonyms only for countries and states (maybe will add cities in future). - FeatureNameInserter inserter( - skipIndex.IsCountryOrState(types) ? m_synonyms : nullptr, m_names); + FeatureNameInserter inserter( + skipIndex.IsCountryOrState(types) ? m_synonyms : nullptr, m_keyValuePairs); m_valueBuilder.MakeValue(f, types, index, inserter.m_val); // Skip types for features without names. @@ -256,9 +258,9 @@ public: } }; -template +template void AddFeatureNameIndexPairs(FeaturesVectorTest & features, CategoriesHolder & categoriesHolder, - StringsFile & stringsFile, + vector> & keyValuePairs, SingleValueSerializer const & serializer) { feature::DataHeader const & header = features.GetHeader(); @@ -269,8 +271,8 @@ void AddFeatureNameIndexPairs(FeaturesVectorTest & features, CategoriesHolder & if (header.GetType() == feature::DataHeader::world) synonyms.reset(new SynonymsHolder(GetPlatform().WritablePathForFile(SYNONYMS_FILE))); - features.GetVector().ForEach(FeatureInserter>( - synonyms.get(), stringsFile, categoriesHolder, header.GetScaleRange(), valueBuilder)); + features.GetVector().ForEach(FeatureInserter( + synonyms.get(), keyValuePairs, categoriesHolder, header.GetScaleRange(), valueBuilder)); } } // namespace @@ -289,14 +291,12 @@ bool BuildSearchIndexFromDataFile(string const & filename, bool forceRebuild) my::GetNameWithoutExt(mwmName); string const indexFilePath = platform.WritablePathForFile(mwmName + ".sdx.tmp"); MY_SCOPE_GUARD(indexFileGuard, bind(&FileWriter::DeleteFileX, indexFilePath)); - string const stringsFilePath = platform.WritablePathForFile(mwmName + ".sdx.strings.tmp"); - MY_SCOPE_GUARD(stringsFileGuard, bind(&FileWriter::DeleteFileX, stringsFilePath)); try { { FileWriter indexWriter(indexFilePath); - BuildSearchIndex(readContainer, indexWriter, stringsFilePath); + BuildSearchIndex(readContainer, indexWriter); LOG(LINFO, ("Search index size =", indexWriter.Size())); } { @@ -319,9 +319,9 @@ bool BuildSearchIndexFromDataFile(string const & filename, bool forceRebuild) return true; } -void BuildSearchIndex(FilesContainerR & container, Writer & indexWriter, - string const & stringsFilePath) +void BuildSearchIndex(FilesContainerR & container, Writer & indexWriter) { + using TKey = strings::UniString; using TValue = FeatureIndexValue; Platform & platform = GetPlatform(); @@ -335,16 +335,14 @@ void BuildSearchIndex(FilesContainerR & container, Writer & indexWriter, auto codingParams = trie::GetCodingParams(features.GetHeader().GetDefCodingParams()); SingleValueSerializer serializer(codingParams); - StringsFile stringsFile(stringsFilePath, serializer); - AddFeatureNameIndexPairs(features, categoriesHolder, stringsFile, serializer); + vector> searchIndexKeyValuePairs; + AddFeatureNameIndexPairs(features, categoriesHolder, searchIndexKeyValuePairs, serializer); - stringsFile.EndAdding(); + sort(searchIndexKeyValuePairs.begin(), searchIndexKeyValuePairs.end()); LOG(LINFO, ("End sorting strings:", timer.ElapsedSeconds())); - stringsFile.OpenForRead(); - - trie::Build::IteratorT, ValueList>( - indexWriter, serializer, stringsFile.Begin(), stringsFile.End()); + trie::Build, SingleValueSerializer>( + indexWriter, serializer, searchIndexKeyValuePairs); LOG(LINFO, ("End building search index, elapsed seconds:", timer.ElapsedSeconds())); } diff --git a/indexer/search_index_builder.hpp b/indexer/search_index_builder.hpp index b2b9d0346c..1648734b00 100644 --- a/indexer/search_index_builder.hpp +++ b/indexer/search_index_builder.hpp @@ -9,6 +9,5 @@ namespace indexer { bool BuildSearchIndexFromDataFile(string const & filename, bool forceRebuild = false); -void BuildSearchIndex(FilesContainerR & container, Writer & indexWriter, - string const & stringsFilePath); +void BuildSearchIndex(FilesContainerR & container, Writer & indexWriter); } // namespace indexer diff --git a/indexer/string_file_values.hpp b/indexer/search_index_values.hpp similarity index 98% rename from indexer/string_file_values.hpp rename to indexer/search_index_values.hpp index e9c79d9482..d97991fafc 100644 --- a/indexer/string_file_values.hpp +++ b/indexer/search_index_values.hpp @@ -167,10 +167,7 @@ public: // compressed bit vector, this method returns 1 when there're at // least one feature's index in the list - so, compressed bit // vector will be built and serialized - and 0 otherwise. - size_t Size() const - { - return (m_cbv && m_cbv->PopCount() != 0) ? 1 : 0; - } + size_t Size() const { return (m_cbv && m_cbv->PopCount() != 0) ? 1 : 0; } bool IsEmpty() const { return Size() == 0; } diff --git a/indexer/search_trie.hpp b/indexer/search_trie.hpp index c715ab306b..1327a5fbd9 100644 --- a/indexer/search_trie.hpp +++ b/indexer/search_trie.hpp @@ -1,7 +1,7 @@ #pragma once #include "indexer/geometry_serialization.hpp" -#include "indexer/string_file_values.hpp" +#include "indexer/search_index_values.hpp" #include "indexer/trie.hpp" #include "indexer/trie_reader.hpp" diff --git a/indexer/string_file.hpp b/indexer/string_file.hpp deleted file mode 100644 index 213a67e5a7..0000000000 --- a/indexer/string_file.hpp +++ /dev/null @@ -1,291 +0,0 @@ -#pragma once - -#include "coding/file_writer.hpp" -#include "coding/file_reader.hpp" -#include "coding/read_write_utils.hpp" - -#include "base/macros.hpp" -#include "base/mem_trie.hpp" -#include "base/string_utils.hpp" -#include "base/worker_thread.hpp" - -#include "std/iterator_facade.hpp" -#include "std/queue.hpp" -#include "std/functional.hpp" -#include "std/unique_ptr.hpp" - -template -class StringsFile -{ -public: - using ValueT = TValue; - using IdT = uint32_t; - - class TString - { - strings::UniString m_name; - ValueT m_val; - - public: - TString() {} - TString(strings::UniString const & name, signed char lang, ValueT const & val) : m_val(val) - { - m_name.reserve(name.size() + 1); - m_name.push_back(static_cast(lang)); - m_name.append(name.begin(), name.end()); - } - - TString(strings::UniString const & langName, ValueT const & val) : m_name(langName), m_val(val) - { - } - - uint32_t GetKeySize() const { return m_name.size(); } - uint32_t const * GetKeyData() const { return m_name.data(); } - - strings::UniString const & GetString() const { return m_name; } - - ValueT const & GetValue() const { return m_val; } - - bool operator<(TString const & name) const - { - if (m_name != name.m_name) - return m_name < name.m_name; - return m_val < name.m_val; - } - - bool operator==(TString const & name) const - { - return m_name == name.m_name && m_val == name.m_val; - } - - template - void Read(TReader & src, SingleValueSerializer const & serializer) - { - rw::Read(src, m_name); - serializer.DeserializeFromSource(src, m_val); - } - - void Swap(TString & r) - { - m_name.swap(r.m_name); - m_val.Swap(r.m_val); - } - }; - - using StringsListT = vector; - - // Contains start and end offsets of file portions. - using OffsetsListT = vector>; - - /// This class encapsulates a task to efficiently sort a bunch of - /// strings and writes them in a sorted oreder. - class SortAndDumpStringsTask - { - public: - /// A class ctor. - /// - /// \param writer A writer that will be used to write strings. - /// \param offsets A list of offsets [begin, end) that denote - /// groups of sorted strings in a file. When strings will be - /// sorted and dumped on a disk, a pair of offsets will be added - /// to the list. - /// \param strings Vector of strings that should be sorted. Internal data is moved out from - /// strings, so it'll become empty after ctor. - SortAndDumpStringsTask(FileWriter & writer, OffsetsListT & offsets, StringsListT & strings, - SingleValueSerializer const & serializer) - : m_writer(writer), m_offsets(offsets), m_serializer(serializer) - { - strings.swap(m_strings); - } - - /// Sorts strings via in-memory trie and writes them. - void operator()() - { - vector memBuffer; - { - my::MemTrie trie; - for (auto const & s : m_strings) - trie.Add(s.GetString(), s.GetValue()); - MemWriter> memWriter(memBuffer); - trie.ForEach([&memWriter, this](const strings::UniString & s, const ValueT & v) - { - rw::Write(memWriter, s); - m_serializer.Serialize(memWriter, v); - }); - } - - uint64_t const spos = m_writer.Pos(); - m_writer.Write(memBuffer.data(), memBuffer.size()); - uint64_t const epos = m_writer.Pos(); - m_offsets.push_back(make_pair(spos, epos)); - m_writer.Flush(); - } - - private: - FileWriter & m_writer; - OffsetsListT & m_offsets; - StringsListT m_strings; - SingleValueSerializer m_serializer; - - DISALLOW_COPY_AND_MOVE(SortAndDumpStringsTask); - }; - - class IteratorT : public iterator_facade - { - StringsFile & m_file; - bool m_end; - - bool IsEnd() const; - inline bool IsValid() const { return (!m_end && !IsEnd()); } - - public: - IteratorT(StringsFile & file, bool isEnd) : m_file(file), m_end(isEnd) - { - // Additional check in case for empty sequence. - if (!m_end) - m_end = IsEnd(); - } - - TString dereference() const; - bool equal(IteratorT const & r) const { return (m_end == r.m_end); } - void increment(); - }; - - StringsFile(string const & filename, SingleValueSerializer const & serializer); - - void EndAdding(); - void OpenForRead(); - - /// @precondition Should be opened for writing. - void AddString(TString const & s); - - IteratorT Begin() { return IteratorT(*this, false); } - IteratorT End() { return IteratorT(*this, true); } - -private: - void Flush(); - bool PushNextValue(size_t i); - - struct QValue - { - TString m_string; - size_t m_index; - - QValue(TString const & s, size_t i) : m_string(s), m_index(i) {} - - inline bool operator>(QValue const & rhs) const { return rhs.m_string < m_string; } - }; - - priority_queue, greater> m_queue; - - // A worker thread that sorts and writes groups of strings. The - // whole process looks like a pipeline, i.e. main thread accumulates - // strings while worker thread sequentially sorts and stores groups - // of strings on a disk. - my::WorkerThread m_workerThread; - - unique_ptr m_writer; - unique_ptr m_reader; - - StringsListT m_strings; - OffsetsListT m_offsets; - - SingleValueSerializer m_serializer; -}; - -template -void StringsFile::AddString(TString const & s) -{ - size_t const kMaxSize = 1000000; - - if (m_strings.size() >= kMaxSize) - Flush(); - - m_strings.push_back(s); -} - -template -bool StringsFile::IteratorT::IsEnd() const -{ - return m_file.m_queue.empty(); -} - -template -typename StringsFile::TString StringsFile::IteratorT::dereference() const -{ - ASSERT(IsValid(), ()); - return m_file.m_queue.top().m_string; -} - -template -void StringsFile::IteratorT::increment() -{ - ASSERT(IsValid(), ()); - int const index = m_file.m_queue.top().m_index; - - m_file.m_queue.pop(); - - if (!m_file.PushNextValue(index)) - m_end = IsEnd(); -} - -template -StringsFile::StringsFile(string const & filename, - SingleValueSerializer const & serializer) - : m_workerThread(1 /* maxTasks */), m_serializer(serializer) -{ - m_writer.reset(new FileWriter(filename)); -} - -template -void StringsFile::Flush() -{ - shared_ptr task( - new SortAndDumpStringsTask(*m_writer, m_offsets, m_strings, m_serializer)); - m_workerThread.Push(task); -} - -template -bool StringsFile::PushNextValue(size_t i) -{ - // reach the end of the portion file - if (m_offsets[i].first >= m_offsets[i].second) - return false; - - // init source to needed offset - ReaderSource src(*m_reader); - src.Skip(m_offsets[i].first); - - // read string - TString s; - s.Read(src, m_serializer); - - // update offset - m_offsets[i].first = src.Pos(); - - // push value to queue - m_queue.push(QValue(s, i)); - return true; -} - -template -void StringsFile::EndAdding() -{ - Flush(); - - m_workerThread.RunUntilIdleAndStop(); - - m_writer->Flush(); -} - -template -void StringsFile::OpenForRead() -{ - string const filename = m_writer->GetName(); - m_writer.reset(); - - m_reader.reset(new FileReader(filename)); - - for (size_t i = 0; i < m_offsets.size(); ++i) - PushNextValue(i); -} diff --git a/indexer/trie_builder.hpp b/indexer/trie_builder.hpp index 61b1254307..9fa7fd205e 100644 --- a/indexer/trie_builder.hpp +++ b/indexer/trie_builder.hpp @@ -228,28 +228,26 @@ void AppendValue(TNodeInfo & node, TValue const & value) LOG(LERROR, ("Cannot append to a finalized value list.")); } -template -void Build(TSink & sink, TSerializer const & serializer, TIter const beg, TIter const end) +template +void Build(TSink & sink, TSerializer const & serializer, + vector> const & data) { - using TTrieString = buffer_vector; + using TValue = typename TValueList::TValue; using TNodeInfo = NodeInfo; vector nodes; nodes.emplace_back(sink.Pos(), kDefaultChar); - TTrieString prevKey; + TKey prevKey; + pair prevE; // e for "element". - using TElement = typename TIter::value_type; - TElement prevE; - - for (TIter it = beg; it != end; ++it) + for (auto it = data.begin(); it != data.end(); ++it) { - TElement e = *it; - if (it != beg && e == prevE) + auto e = *it; + if (it != data.begin() && e == prevE) continue; - TrieChar const * const pKeyData = e.GetKeyData(); - TTrieString key(pKeyData, pKeyData + e.GetKeySize()); + auto const & key = e.first; CHECK(!(key < prevKey), (key, prevKey)); size_t nCommon = 0; while (nCommon < min(key.size(), prevKey.size()) && prevKey[nCommon] == key[nCommon]) @@ -260,10 +258,10 @@ void Build(TSink & sink, TSerializer const & serializer, TIter const beg, TIter uint64_t const pos = sink.Pos(); for (size_t i = nCommon; i < key.size(); ++i) nodes.emplace_back(pos, key[i]); - AppendValue(nodes.back(), e.GetValue()); + AppendValue(nodes.back(), e.second); - prevKey.swap(key); - prevE.Swap(e); + prevKey = key; + swap(e, prevE); } // Pop all the nodes from the stack. diff --git a/xcode/indexer/indexer.xcodeproj/project.pbxproj b/xcode/indexer/indexer.xcodeproj/project.pbxproj index e8fa2689d2..b359ae464f 100644 --- a/xcode/indexer/indexer.xcodeproj/project.pbxproj +++ b/xcode/indexer/indexer.xcodeproj/project.pbxproj @@ -17,6 +17,7 @@ 670C61131AB065B100C38A8C /* index_builder_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670C61001AB065B100C38A8C /* index_builder_test.cpp */; }; 670C61141AB065B100C38A8C /* index_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670C61011AB065B100C38A8C /* index_test.cpp */; }; 670C61151AB065B100C38A8C /* interval_index_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670C61021AB065B100C38A8C /* interval_index_test.cpp */; }; + 670C61161AB065B100C38A8C /* mercator_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670C61031AB065B100C38A8C /* mercator_test.cpp */; }; 670C61171AB065B100C38A8C /* mwm_set_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670C61041AB065B100C38A8C /* mwm_set_test.cpp */; }; 670C61181AB065B100C38A8C /* point_to_int64_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670C61051AB065B100C38A8C /* point_to_int64_test.cpp */; }; 670C61191AB065B100C38A8C /* scales_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670C61061AB065B100C38A8C /* scales_test.cpp */; }; @@ -39,8 +40,9 @@ 670C61561AB0689F00C38A8C /* libgeometry.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 670C61551AB0689F00C38A8C /* libgeometry.a */; }; 670C615B1AB0691900C38A8C /* features_offsets_table.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670C61581AB0691900C38A8C /* features_offsets_table.cpp */; }; 670C615C1AB0691900C38A8C /* features_offsets_table.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 670C61591AB0691900C38A8C /* features_offsets_table.hpp */; }; - 670C615D1AB0691900C38A8C /* string_file_values.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 670C615A1AB0691900C38A8C /* string_file_values.hpp */; }; + 670C615D1AB0691900C38A8C /* search_index_values.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 670C615A1AB0691900C38A8C /* search_index_values.hpp */; }; 670C620B1AC3550F00C38A8C /* libopening_hours.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 670C620A1AC3550F00C38A8C /* libopening_hours.a */; }; + 670C620D1AC59E6300C38A8C /* opening_hours_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670C615E1AB0B02B00C38A8C /* opening_hours_test.cpp */; }; 670D04AB1B0BA8580013A7AC /* feature_loader_101.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670D04A81B0BA8580013A7AC /* feature_loader_101.cpp */; }; 670D04AC1B0BA8580013A7AC /* feature_loader_101.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 670D04A91B0BA8580013A7AC /* feature_loader_101.hpp */; }; 670D04AD1B0BA8580013A7AC /* interval_index_101.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 670D04AA1B0BA8580013A7AC /* interval_index_101.hpp */; }; @@ -107,6 +109,8 @@ 675341321A3F540F00A0A8C3 /* interval_index_builder.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675340DF1A3F540F00A0A8C3 /* interval_index_builder.hpp */; }; 675341331A3F540F00A0A8C3 /* interval_index_iface.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675340E01A3F540F00A0A8C3 /* interval_index_iface.hpp */; }; 675341341A3F540F00A0A8C3 /* interval_index.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675340E11A3F540F00A0A8C3 /* interval_index.hpp */; }; + 675341351A3F540F00A0A8C3 /* mercator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675340E21A3F540F00A0A8C3 /* mercator.cpp */; }; + 675341361A3F540F00A0A8C3 /* mercator.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675340E31A3F540F00A0A8C3 /* mercator.hpp */; }; 675341371A3F540F00A0A8C3 /* mwm_set.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675340E41A3F540F00A0A8C3 /* mwm_set.cpp */; }; 675341381A3F540F00A0A8C3 /* mwm_set.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675340E51A3F540F00A0A8C3 /* mwm_set.hpp */; }; 6753413B1A3F540F00A0A8C3 /* point_to_int64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675340E91A3F540F00A0A8C3 /* point_to_int64.cpp */; }; @@ -127,11 +131,11 @@ 6753414C1A3F540F00A0A8C3 /* tree_structure.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675340FA1A3F540F00A0A8C3 /* tree_structure.hpp */; }; 6753414D1A3F540F00A0A8C3 /* types_mapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675340FB1A3F540F00A0A8C3 /* types_mapping.cpp */; }; 6753414E1A3F540F00A0A8C3 /* types_mapping.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675340FC1A3F540F00A0A8C3 /* types_mapping.hpp */; }; - 6758AED11BB4413000C26E27 /* drules_selector_parser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6758AECD1BB4413000C26E27 /* drules_selector_parser.cpp */; }; - 6758AED21BB4413000C26E27 /* drules_selector_parser.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 6758AECE1BB4413000C26E27 /* drules_selector_parser.hpp */; }; - 6758AED31BB4413000C26E27 /* drules_selector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6758AECF1BB4413000C26E27 /* drules_selector.cpp */; }; - 6758AED41BB4413000C26E27 /* drules_selector.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 6758AED01BB4413000C26E27 /* drules_selector.hpp */; }; - 67F183731BD4FCF500AB1840 /* map_style.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 67F183721BD4FCF500AB1840 /* map_style.cpp */; }; + 6758AED11BB4413000C26E27 /* drules_selector_parser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6758AECD1BB4413000C26E27 /* drules_selector_parser.cpp */; settings = {ASSET_TAGS = (); }; }; + 6758AED21BB4413000C26E27 /* drules_selector_parser.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 6758AECE1BB4413000C26E27 /* drules_selector_parser.hpp */; settings = {ASSET_TAGS = (); }; }; + 6758AED31BB4413000C26E27 /* drules_selector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6758AECF1BB4413000C26E27 /* drules_selector.cpp */; settings = {ASSET_TAGS = (); }; }; + 6758AED41BB4413000C26E27 /* drules_selector.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 6758AED01BB4413000C26E27 /* drules_selector.hpp */; settings = {ASSET_TAGS = (); }; }; + 67F183731BD4FCF500AB1840 /* map_style.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 67F183721BD4FCF500AB1840 /* map_style.cpp */; settings = {ASSET_TAGS = (); }; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -157,6 +161,7 @@ 670C61001AB065B100C38A8C /* index_builder_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = index_builder_test.cpp; sourceTree = ""; }; 670C61011AB065B100C38A8C /* index_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = index_test.cpp; sourceTree = ""; }; 670C61021AB065B100C38A8C /* interval_index_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = interval_index_test.cpp; sourceTree = ""; }; + 670C61031AB065B100C38A8C /* mercator_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mercator_test.cpp; sourceTree = ""; }; 670C61041AB065B100C38A8C /* mwm_set_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mwm_set_test.cpp; sourceTree = ""; }; 670C61051AB065B100C38A8C /* point_to_int64_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = point_to_int64_test.cpp; sourceTree = ""; }; 670C61061AB065B100C38A8C /* scales_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = scales_test.cpp; sourceTree = ""; }; @@ -167,21 +172,22 @@ 670C610B1AB065B100C38A8C /* visibility_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = visibility_test.cpp; sourceTree = ""; }; 670C611F1AB065E100C38A8C /* testingmain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = testingmain.cpp; path = ../../testing/testingmain.cpp; sourceTree = ""; }; 670C61251AB0661100C38A8C /* indexer_tests */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = indexer_tests; sourceTree = BUILT_PRODUCTS_DIR; }; - 670C61411AB0670700C38A8C /* libplatform.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libplatform.a; path = "../../../omim-xcode-build/Debug-iphonesimulator/libplatform.a"; sourceTree = ""; }; - 670C61431AB0673800C38A8C /* libbase.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libbase.a; path = "../../../omim-xcode-build/Debug-iphonesimulator/libbase.a"; sourceTree = ""; }; - 670C61441AB0673800C38A8C /* libcoding.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcoding.a; path = "../../../omim-xcode-build/Debug-iphonesimulator/libcoding.a"; sourceTree = ""; }; + 670C61411AB0670700C38A8C /* libplatform.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libplatform.a; path = ../platform/build/Debug/libplatform.a; sourceTree = ""; }; + 670C61431AB0673800C38A8C /* libbase.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libbase.a; path = ../base/build/Debug/libbase.a; sourceTree = ""; }; + 670C61441AB0673800C38A8C /* libcoding.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcoding.a; path = ../coding/build/Debug/libcoding.a; sourceTree = ""; }; 670C61471AB0675700C38A8C /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; 670C61491AB0677200C38A8C /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; }; 670C614B1AB067D200C38A8C /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 670C614D1AB0682300C38A8C /* QtCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QtCore.framework; path = /usr/local/Cellar/qt5/5.3.2/lib/QtCore.framework; sourceTree = ""; }; - 670C614F1AB0684000C38A8C /* libprotobuf.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libprotobuf.a; path = "../../../omim-xcode-build/Debug-iphonesimulator/libprotobuf.a"; sourceTree = ""; }; - 670C61511AB0685E00C38A8C /* libtomcrypt.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libtomcrypt.a; path = "../../../omim-xcode-build/Debug-iphonesimulator/libtomcrypt.a"; sourceTree = ""; }; - 670C61531AB0688100C38A8C /* libstorage.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libstorage.a; path = "../../../omim-xcode-build/Debug-iphonesimulator/libstorage.a"; sourceTree = ""; }; - 670C61551AB0689F00C38A8C /* libgeometry.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libgeometry.a; path = "../../../omim-xcode-build/Debug-iphonesimulator/libgeometry.a"; sourceTree = ""; }; + 670C614F1AB0684000C38A8C /* libprotobuf.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libprotobuf.a; path = /usr/local/Cellar/protobuf/2.5.0/lib/libprotobuf.a; sourceTree = ""; }; + 670C61511AB0685E00C38A8C /* libtomcrypt.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libtomcrypt.a; path = "../../../Library/Developer/Xcode/DerivedData/omim-baysrswfihipzadzzkpyheldfppg/Build/Products/Debug/libtomcrypt.a"; sourceTree = ""; }; + 670C61531AB0688100C38A8C /* libstorage.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libstorage.a; path = "../../../Library/Developer/Xcode/DerivedData/omim-baysrswfihipzadzzkpyheldfppg/Build/Products/Debug/libstorage.a"; sourceTree = ""; }; + 670C61551AB0689F00C38A8C /* libgeometry.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libgeometry.a; path = "../../../Library/Developer/Xcode/DerivedData/omim-baysrswfihipzadzzkpyheldfppg/Build/Products/Debug/libgeometry.a"; sourceTree = ""; }; 670C61581AB0691900C38A8C /* features_offsets_table.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = features_offsets_table.cpp; sourceTree = ""; }; 670C61591AB0691900C38A8C /* features_offsets_table.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = features_offsets_table.hpp; sourceTree = ""; }; - 670C615A1AB0691900C38A8C /* string_file_values.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = string_file_values.hpp; sourceTree = ""; }; - 670C620A1AC3550F00C38A8C /* libopening_hours.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libopening_hours.a; path = "../../../omim-xcode-build/Debug-iphonesimulator/libopening_hours.a"; sourceTree = ""; }; + 670C615A1AB0691900C38A8C /* search_index_values.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = search_index_values.hpp; sourceTree = ""; }; + 670C615E1AB0B02B00C38A8C /* opening_hours_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = opening_hours_test.cpp; sourceTree = ""; }; + 670C620A1AC3550F00C38A8C /* libopening_hours.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libopening_hours.a; path = ../opening_hours/build/Debug/libopening_hours.a; sourceTree = ""; }; 670D04A81B0BA8580013A7AC /* feature_loader_101.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = feature_loader_101.cpp; sourceTree = ""; }; 670D04A91B0BA8580013A7AC /* feature_loader_101.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = feature_loader_101.hpp; sourceTree = ""; }; 670D04AA1B0BA8580013A7AC /* interval_index_101.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = interval_index_101.hpp; sourceTree = ""; }; @@ -251,6 +257,8 @@ 675340DF1A3F540F00A0A8C3 /* interval_index_builder.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = interval_index_builder.hpp; sourceTree = ""; }; 675340E01A3F540F00A0A8C3 /* interval_index_iface.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = interval_index_iface.hpp; sourceTree = ""; }; 675340E11A3F540F00A0A8C3 /* interval_index.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = interval_index.hpp; sourceTree = ""; }; + 675340E21A3F540F00A0A8C3 /* mercator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mercator.cpp; sourceTree = ""; }; + 675340E31A3F540F00A0A8C3 /* mercator.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = mercator.hpp; sourceTree = ""; }; 675340E41A3F540F00A0A8C3 /* mwm_set.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mwm_set.cpp; sourceTree = ""; }; 675340E51A3F540F00A0A8C3 /* mwm_set.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = mwm_set.hpp; sourceTree = ""; }; 675340E91A3F540F00A0A8C3 /* point_to_int64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = point_to_int64.cpp; sourceTree = ""; }; @@ -322,6 +330,7 @@ 670C61001AB065B100C38A8C /* index_builder_test.cpp */, 670C61011AB065B100C38A8C /* index_test.cpp */, 670C61021AB065B100C38A8C /* interval_index_test.cpp */, + 670C61031AB065B100C38A8C /* mercator_test.cpp */, 670C61041AB065B100C38A8C /* mwm_set_test.cpp */, 670C61051AB065B100C38A8C /* point_to_int64_test.cpp */, 670C61061AB065B100C38A8C /* scales_test.cpp */, @@ -330,6 +339,7 @@ 670C61091AB065B100C38A8C /* test_polylines.hpp */, 670C610A1AB065B100C38A8C /* test_type.cpp */, 670C610B1AB065B100C38A8C /* visibility_test.cpp */, + 670C615E1AB0B02B00C38A8C /* opening_hours_test.cpp */, ); name = indexer_tests; path = ../../indexer/indexer_tests; @@ -397,7 +407,7 @@ 67F183721BD4FCF500AB1840 /* map_style.cpp */, 670C61581AB0691900C38A8C /* features_offsets_table.cpp */, 670C61591AB0691900C38A8C /* features_offsets_table.hpp */, - 670C615A1AB0691900C38A8C /* string_file_values.hpp */, + 670C615A1AB0691900C38A8C /* search_index_values.hpp */, 675340A81A3F540F00A0A8C3 /* categories_holder.cpp */, 675340A91A3F540F00A0A8C3 /* categories_holder.hpp */, 675340AA1A3F540F00A0A8C3 /* cell_coverer.hpp */, @@ -458,6 +468,8 @@ 675340DF1A3F540F00A0A8C3 /* interval_index_builder.hpp */, 675340E01A3F540F00A0A8C3 /* interval_index_iface.hpp */, 675340E11A3F540F00A0A8C3 /* interval_index.hpp */, + 675340E21A3F540F00A0A8C3 /* mercator.cpp */, + 675340E31A3F540F00A0A8C3 /* mercator.hpp */, 675340E41A3F540F00A0A8C3 /* mwm_set.cpp */, 675340E51A3F540F00A0A8C3 /* mwm_set.hpp */, 675340E91A3F540F00A0A8C3 /* point_to_int64.cpp */, @@ -491,6 +503,7 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( + 675341361A3F540F00A0A8C3 /* mercator.hpp in Headers */, 6753414E1A3F540F00A0A8C3 /* types_mapping.hpp in Headers */, 6753411F1A3F540F00A0A8C3 /* feature_loader.hpp in Headers */, 675341151A3F540F00A0A8C3 /* feature_covering.hpp in Headers */, @@ -528,7 +541,7 @@ 6758AED41BB4413000C26E27 /* drules_selector.hpp in Headers */, 675341061A3F540F00A0A8C3 /* coding_params.hpp in Headers */, 6753412F1A3F540F00A0A8C3 /* index_builder.hpp in Headers */, - 670C615D1AB0691900C38A8C /* string_file_values.hpp in Headers */, + 670C615D1AB0691900C38A8C /* search_index_values.hpp in Headers */, 675341411A3F540F00A0A8C3 /* scales.hpp in Headers */, 675341321A3F540F00A0A8C3 /* interval_index_builder.hpp in Headers */, 6753414B1A3F540F00A0A8C3 /* tesselator_decl.hpp in Headers */, @@ -627,6 +640,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 670C620D1AC59E6300C38A8C /* opening_hours_test.cpp in Sources */, 670C612C1AB0663400C38A8C /* testingmain.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -642,7 +656,9 @@ 6758AED31BB4413000C26E27 /* drules_selector.cpp in Sources */, 6753411A1A3F540F00A0A8C3 /* feature_impl.cpp in Sources */, 670C61111AB065B100C38A8C /* geometry_coding_test.cpp in Sources */, + 675341351A3F540F00A0A8C3 /* mercator.cpp in Sources */, 6753410D1A3F540F00A0A8C3 /* drawing_rules.cpp in Sources */, + 670C61161AB065B100C38A8C /* mercator_test.cpp in Sources */, 675341421A3F540F00A0A8C3 /* search_delimiters.cpp in Sources */, 670C611E1AB065B100C38A8C /* visibility_test.cpp in Sources */, 675341301A3F540F00A0A8C3 /* index.cpp in Sources */,