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:
-rw-r--r--defines.hpp1
-rw-r--r--indexer/data_factory.cpp5
-rw-r--r--indexer/data_factory.hpp3
-rw-r--r--indexer/feature_meta.hpp21
4 files changed, 30 insertions, 0 deletions
diff --git a/defines.hpp b/defines.hpp
index b35ed0a154..3f25caee41 100644
--- a/defines.hpp
+++ b/defines.hpp
@@ -27,6 +27,7 @@
#define METADATA_INDEX_FILE_TAG "metaidx"
#define FEATURE_OFFSETS_FILE_TAG "offs"
#define RANKS_FILE_TAG "ranks"
+#define REGION_INFO_FILE_TAG "info"
// Temporary addresses section that is used in search index generation.
#define SEARCH_TOKENS_FILE_TAG "addrtags"
diff --git a/indexer/data_factory.cpp b/indexer/data_factory.cpp
index b9ac8abc86..965f3f1edf 100644
--- a/indexer/data_factory.cpp
+++ b/indexer/data_factory.cpp
@@ -1,12 +1,17 @@
+#include "coding/file_container.hpp"
#include "indexer/data_factory.hpp"
#include "indexer/interval_index.hpp"
#include "indexer/old/interval_index_101.hpp"
+#include "defines.hpp"
void IndexFactory::Load(FilesContainerR const & cont)
{
ReadVersion(cont, m_version);
m_header.Load(cont);
+
+ ReaderSource<FilesContainerR::TReader> src(cont.GetReader(REGION_INFO_FILE_TAG));
+ m_region.Deserialize(src);
}
IntervalIndexIFace * IndexFactory::CreateIndex(ModelReaderPtr reader) const
diff --git a/indexer/data_factory.hpp b/indexer/data_factory.hpp
index d063fe8a72..3bda00c867 100644
--- a/indexer/data_factory.hpp
+++ b/indexer/data_factory.hpp
@@ -1,5 +1,6 @@
#pragma once
#include "indexer/data_header.hpp"
+#include "indexer/feature_meta.hpp"
#include "platform/mwm_version.hpp"
@@ -11,12 +12,14 @@ class IndexFactory
{
version::MwmVersion m_version;
feature::DataHeader m_header;
+ feature::RegionData m_region;
public:
void Load(FilesContainerR const & cont);
inline version::MwmVersion const & GetMwmVersion() const { return m_version; }
inline feature::DataHeader const & GetHeader() const { return m_header; }
+ inline feature::RegionData const & GetRegion() const { return m_region; }
IntervalIndexIFace * CreateIndex(ModelReaderPtr reader) const;
};
diff --git a/indexer/feature_meta.hpp b/indexer/feature_meta.hpp
index 6d1048eab3..5fccebc38b 100644
--- a/indexer/feature_meta.hpp
+++ b/indexer/feature_meta.hpp
@@ -186,6 +186,27 @@ public:
MetadataBase::Set(type, s);
}
};
+
+class RegionData : public MetadataBase
+{
+public:
+ enum Type
+ {
+ RD_LANGUAGES, // list of written languages
+ RD_DRIVING, // left- or right-hand driving (letter 'l' or 'r')
+ RD_TIMEZONE, // UTC timezone offset, floating signed number of hours: -3, 4.5
+ RD_ADDRESS_FORMAT, // address format, re: mapzen
+ RD_PHONE_FORMAT, // list of strings in "+N NNN NN-NN-NN" format
+ RD_POSTCODE_FORMAT, // list of strings in "AAA ANN" format
+ RD_PUBLIC_HOLIDAYS, // fixed PH dates
+ RD_ALLOW_HOUSENAMES // 'y' if housenames are commonly used
+ };
+
+ void Add(Type type, string const & s)
+ {
+ MetadataBase::Set(type, s);
+ }
+};
} // namespace feature
// Prints types in osm-friendly format.