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>2011-11-25 03:54:40 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:28:52 +0300
commit90b9e3c3cf6c1929234088a0e7686466a1c9e1a1 (patch)
treec724666106493765de579142598fbc03b67e7bc5 /indexer/classificator_loader.cpp
parent13a7ef1f6b9b344915b94c10527d476398bb82aa (diff)
Do not halt when drules_proto.bin is absent. Reading drules_proto.txt.
Diffstat (limited to 'indexer/classificator_loader.cpp')
-rw-r--r--indexer/classificator_loader.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/indexer/classificator_loader.cpp b/indexer/classificator_loader.cpp
index 6b2d80026e..6c11be5646 100644
--- a/indexer/classificator_loader.cpp
+++ b/indexer/classificator_loader.cpp
@@ -68,26 +68,19 @@ namespace classificator
try
{
- // Load from protobuffer binary file.
+ // Load from proto buffer binary file.
ReaderStreamBuf buffer(p.GetReader(DRAWING_RULES_BIN_FILE));
istream s(&buffer);
rules.LoadFromBinaryProto(s);
}
- catch (Reader::OpenException const &)
+ catch (FileAbsentException const &)
{
- try
- {
- // Load from protobuffer text file.
- string buffer;
- ModelReaderPtr(p.GetReader(DRAWING_RULES_TXT_FILE)).ReadAsString(buffer);
-
- rules.LoadFromTextProto(buffer);
- }
- catch (Reader::OpenException const &)
- {
- LOG(LERROR, ("No drawing rules found"));
- }
+ // Load from proto buffer text file.
+ string buffer;
+ ModelReaderPtr(p.GetReader(DRAWING_RULES_TXT_FILE)).ReadAsString(buffer);
+
+ rules.LoadFromTextProto(buffer);
}
LOG(LINFO, ("Reading of classificator finished"));