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>2012-02-06 18:27:09 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:33:12 +0300
commitdb74ea08f6e392ae496852a110bbed7e361f7a31 (patch)
tree8c310d0b9bf0f16c0ef447422d45f967a23257c9 /indexer/drawing_rules.cpp
parent9748df36ed5ca260e6f950de85ada29a82333d20 (diff)
[search] Use protobuf in lite mode for production configuration.
Diffstat (limited to 'indexer/drawing_rules.cpp')
-rw-r--r--indexer/drawing_rules.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/indexer/drawing_rules.cpp b/indexer/drawing_rules.cpp
index f641353953..15d937f997 100644
--- a/indexer/drawing_rules.cpp
+++ b/indexer/drawing_rules.cpp
@@ -3,7 +3,12 @@
#include "drawing_rules.hpp"
#include "scales.hpp"
#include "classificator.hpp"
-#include "drules_struct.pb.h"
+
+#ifdef OMIM_PRODUCTION
+ #include "drules_struct_lite.pb.h"
+#else
+ #include "drules_struct.pb.h"
+#endif
#include "../std/bind.hpp"
#include "../std/iterator_facade.hpp"
@@ -360,6 +365,7 @@ namespace
};
}
+#ifndef OMIM_PRODUCTION
void RulesHolder::LoadFromTextProto(string const & buffer)
{
Clean();
@@ -377,14 +383,15 @@ void RulesHolder::SaveToBinaryProto(string const & buffer, ostream & s)
CHECK ( cont.SerializeToOstream(&s), ("Error in proto saving!") );
}
+#endif
-void RulesHolder::LoadFromBinaryProto(istream & s)
+void RulesHolder::LoadFromBinaryProto(string const & s)
{
Clean();
DoSetIndex doSet(*this);
- CHECK ( doSet.m_cont.ParseFromIstream(&s), ("Error in proto loading!") );
+ CHECK ( doSet.m_cont.ParseFromString(s), ("Error in proto loading!") );
classif().GetMutableRoot()->ForEachObject(bind<void>(ref(doSet), _1));
}