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-06-30 10:52:22 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:20:14 +0300
commit233683d1670e89076c82401e2693315046c7244e (patch)
tree3b0a9b71d53e853e663da18c362f6ba267b1bc85 /indexer/classificator_loader.cpp
parentf0587a9105b5519903f4f2c3dada1ee3572e7ce1 (diff)
[Refactoring] Use Reader interface everywhere, when possible. Platform class now is a Reader factory.
Diffstat (limited to 'indexer/classificator_loader.cpp')
-rw-r--r--indexer/classificator_loader.cpp30
1 files changed, 23 insertions, 7 deletions
diff --git a/indexer/classificator_loader.cpp b/indexer/classificator_loader.cpp
index 3dbbbe9c53..23a1b74a7c 100644
--- a/indexer/classificator_loader.cpp
+++ b/indexer/classificator_loader.cpp
@@ -1,22 +1,38 @@
#include "classificator_loader.hpp"
+#include "file_reader_stream.hpp"
#include "classificator.hpp"
#include "drawing_rules.hpp"
-#include "../coding/reader.hpp"
+#include "../coding/file_reader.hpp"
+
#include "../base/logging.hpp"
+
namespace classificator
{
- void Read(string const & rules, string const & classificator, string const & visibility)
+ void Read(file_t const & rules, file_t const & classificator, file_t const & visibility)
{
LOG(LINFO, ("Reading drawing rules"));
- drule::ReadRules(rules.c_str());
+ ReaderPtrStream rulesS(rules);
+ drule::ReadRules(rulesS);
+
+ string buffer;
+
LOG(LINFO, ("Reading classificator"));
- if (!classif().ReadClassificator(classificator.c_str()))
- MYTHROW(Reader::OpenException, ("drawing rules or classificator file"));
+ classificator.ReadAsString(buffer);
+ classif().ReadClassificator(buffer);
LOG(LINFO, ("Reading visibility"));
- (void)classif().ReadVisibility(visibility.c_str());
- LOG(LINFO, ("Reading visibility done"));
+ visibility.ReadAsString(buffer);
+ classif().ReadVisibility(buffer);
+
+ LOG(LINFO, ("Reading of classificator done"));
+ }
+
+ void ReadVisibility(string const & fPath)
+ {
+ string buffer;
+ file_t(new FileReader(fPath)).ReadAsString(buffer);
+ classif().ReadVisibility(buffer);
}
}