diff options
author | vng <viktor.govako@gmail.com> | 2015-10-09 18:46:57 +0300 |
---|---|---|
committer | vng <viktor.govako@gmail.com> | 2015-10-12 12:36:38 +0300 |
commit | 93fb8cdc33a6a515c4de798f773680db1562a05d (patch) | |
tree | c3acb62800885690efe760492b385fd93eb0fce2 /indexer/features_offsets_table.cpp | |
parent | f4082a8ef7f6a7057f66afb7369101bc59937cd7 (diff) |
[mwm] Put feature offsets table into MWM container.
Diffstat (limited to 'indexer/features_offsets_table.cpp')
-rw-r--r-- | indexer/features_offsets_table.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/indexer/features_offsets_table.cpp b/indexer/features_offsets_table.cpp index 2b6d9e19fe..a16d88f2cb 100644 --- a/indexer/features_offsets_table.cpp +++ b/indexer/features_offsets_table.cpp @@ -65,6 +65,19 @@ namespace feature } // static + unique_ptr<FeaturesOffsetsTable> FeaturesOffsetsTable::Load(FilesContainerR const & cont) + { + unique_ptr<FeaturesOffsetsTable> ptr(new FeaturesOffsetsTable()); + + ptr->m_file.Open(cont.GetFileName()); + auto p = cont.GetAbsoluteOffsetAndSize(FEATURE_OFFSETS_FILE_TAG); + ptr->m_handle.Assign(ptr->m_file.Map(p.first, p.second, FEATURE_OFFSETS_FILE_TAG)); + + succinct::mapper::map(ptr->m_table, ptr->m_handle.GetData<char>()); + return ptr; + } + + // static unique_ptr<FeaturesOffsetsTable> FeaturesOffsetsTable::CreateImpl( platform::LocalCountryFile const & localFile, FilesContainerR const & cont, string const & storePath) @@ -73,6 +86,12 @@ namespace feature CountryIndexes::PreparePlaceOnDisk(localFile); + return Build(cont, storePath); + } + + unique_ptr<FeaturesOffsetsTable> FeaturesOffsetsTable::Build(FilesContainerR const & cont, + string const & storePath) + { Builder builder; FeaturesVector::ForEachOffset(cont.GetReader(DATA_FILE_TAG), [&builder] (uint32_t offset) { |