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:
authorvng <viktor.govako@gmail.com>2015-10-09 18:46:57 +0300
committervng <viktor.govako@gmail.com>2015-10-12 12:36:38 +0300
commit93fb8cdc33a6a515c4de798f773680db1562a05d (patch)
treec3acb62800885690efe760492b385fd93eb0fce2 /indexer/features_offsets_table.cpp
parentf4082a8ef7f6a7057f66afb7369101bc59937cd7 (diff)
[mwm] Put feature offsets table into MWM container.
Diffstat (limited to 'indexer/features_offsets_table.cpp')
-rw-r--r--indexer/features_offsets_table.cpp19
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)
{