diff options
author | vng <viktor.govako@gmail.com> | 2011-11-25 00:49:10 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:28:45 +0300 |
commit | aeab46c84fabb306bf33580511b968a51787e68f (patch) | |
tree | cc8a3bd97ba88022b2971498063c16f412f3a9eb /indexer/classificator_loader.cpp | |
parent | f28bb0b4908487f35ab54f038ec164a13c3cc027 (diff) |
Add binary drawing rules generation from text rules file.
Diffstat (limited to 'indexer/classificator_loader.cpp')
-rw-r--r-- | indexer/classificator_loader.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/indexer/classificator_loader.cpp b/indexer/classificator_loader.cpp index 5ad83f25e3..6b2d80026e 100644 --- a/indexer/classificator_loader.cpp +++ b/indexer/classificator_loader.cpp @@ -2,7 +2,9 @@ #include "classificator.hpp" #include "drawing_rules.hpp" -#include "../../platform/platform.hpp" +#include "../defines.hpp" + +#include "../platform/platform.hpp" #include "../coding/reader_streambuf.hpp" @@ -67,7 +69,7 @@ namespace classificator try { // Load from protobuffer binary file. - ReaderStreamBuf buffer(p.GetReader("drules_proto.bin")); + ReaderStreamBuf buffer(p.GetReader(DRAWING_RULES_BIN_FILE)); istream s(&buffer); rules.LoadFromBinaryProto(s); @@ -78,13 +80,9 @@ namespace classificator { // Load from protobuffer text file. string buffer; - ModelReaderPtr(p.GetReader("drules_proto.txt")).ReadAsString(buffer); + ModelReaderPtr(p.GetReader(DRAWING_RULES_TXT_FILE)).ReadAsString(buffer); rules.LoadFromTextProto(buffer); - - // Uncomment this to save actual drawing rules to binary proto format. - //ofstream s(p.WritablePathForFile("drules_proto.bin").c_str(), ios::out | ios::binary); - //rules.SaveToBinaryProto(buffer, s); } catch (Reader::OpenException const &) { |