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:
authorYury Melnichek <melnichek@gmail.com>2011-09-22 17:03:12 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:24:12 +0300
commitc5dbcf62dbaffb8f45b26e79a2d31e0ed04eeea1 (patch)
tree1c69e0c705d8cb54a30d1379b6d294cec7b62241 /indexer/index.cpp
parent36ecd0526d87db9e9c19d20f8333c45eb91b80f9 (diff)
Index refactoring. Breaks unit tests!!
Diffstat (limited to 'indexer/index.cpp')
-rw-r--r--indexer/index.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/indexer/index.cpp b/indexer/index.cpp
new file mode 100644
index 0000000000..8c4bdb26e2
--- /dev/null
+++ b/indexer/index.cpp
@@ -0,0 +1,26 @@
+#include "index.hpp"
+#include "data_header.hpp"
+#include "../platform/platform.hpp"
+#include "../std/bind.hpp"
+
+namespace
+{
+FilesContainerR * CreateFileContainer(string const & fileName)
+{
+ return new FilesContainerR(fileName);
+}
+} // unnamed namespace
+
+Index::Index() : MwmSet(bind(&Index::FillInMwmInfo, this, _1, _2), &CreateFileContainer)
+{
+}
+
+void Index::FillInMwmInfo(string const & fileName, MwmInfo & info)
+{
+ IndexFactory factory;
+ factory.Load(FilesContainerR(GetPlatform().GetReader(fileName)));
+ feature::DataHeader const & h = factory.GetHeader();
+ info.m_limitRect = h.GetBounds();
+ info.m_minScale = static_cast<uint8_t>(h.GetScaleRange().first);
+ info.m_maxScale = static_cast<uint8_t>(h.GetScaleRange().second);
+}