diff options
Diffstat (limited to 'generator')
-rw-r--r-- | generator/dumper.cpp | 2 | ||||
-rw-r--r-- | generator/generator_tests/feature_bucketer_test.cpp | 6 | ||||
-rw-r--r-- | generator/generator_tool/generator_tool.cpp | 10 | ||||
-rw-r--r-- | generator/statistics.cpp | 2 |
4 files changed, 11 insertions, 9 deletions
diff --git a/generator/dumper.cpp b/generator/dumper.cpp index dd8ee08350..6693bde894 100644 --- a/generator/dumper.cpp +++ b/generator/dumper.cpp @@ -51,7 +51,7 @@ namespace feature void DumpTypes(string const & datFile) { TypesCollector doClass; - feature::ForEachFromDat(datFile, doClass); + feature::ForEachFromDat(new FileReader(datFile), doClass); typedef vector<stats_elem_type> vec_to_sort; vec_to_sort vecToSort(doClass.m_stats.begin(), doClass.m_stats.end()); diff --git a/generator/generator_tests/feature_bucketer_test.cpp b/generator/generator_tests/feature_bucketer_test.cpp index 4341828010..39f22e8b01 100644 --- a/generator/generator_tests/feature_bucketer_test.cpp +++ b/generator/generator_tests/feature_bucketer_test.cpp @@ -49,9 +49,9 @@ UNIT_TEST(FeatureBucketerSmokeTest) { // classificator is needed because inside bucketer we're use it in WorldMapGenerator // @TODO clean up or remove cell bucketer and replace with world countries bucketer - classificator::Read(GetPlatform().ReadPathForFile("drawing_rules.bin"), - GetPlatform().ReadPathForFile("classificator.txt"), - GetPlatform().ReadPathForFile("visibility.txt")); + classificator::Read(GetPlatform().GetReader("drawing_rules.bin"), + GetPlatform().GetReader("classificator.txt"), + GetPlatform().GetReader("visibility.txt")); map<string, vector<string> > out, expectedOut; FeatureBucketer bucketer(1, &out); diff --git a/generator/generator_tool/generator_tool.cpp b/generator/generator_tool/generator_tool.cpp index 3224a5b7a0..3008ed9037 100644 --- a/generator/generator_tool/generator_tool.cpp +++ b/generator/generator_tool/generator_tool.cpp @@ -80,8 +80,10 @@ int main(int argc, char ** argv) google::ParseCommandLineFlags(&argc, &argv, true); + Platform & pl = GetPlatform(); + string const path = - FLAGS_data_path.empty() ? GetPlatform().WritableDir() : AddSlashIfNeeded(FLAGS_data_path); + FLAGS_data_path.empty() ? pl.WritableDir() : AddSlashIfNeeded(FLAGS_data_path); if (FLAGS_version) { @@ -115,9 +117,9 @@ int main(int argc, char ** argv) if (FLAGS_generate_features || FLAGS_generate_geometry || FLAGS_generate_index || FLAGS_calc_statistics || FLAGS_dump_types) { - classificator::Read(path + "drawing_rules.bin", - path + "classificator.txt", - path + "visibility.txt"); + classificator::Read(pl.GetReader("drawing_rules.bin"), + pl.GetReader("classificator.txt"), + pl.GetReader("visibility.txt")); classificator::PrepareForFeatureGeneration(); } diff --git a/generator/statistics.cpp b/generator/statistics.cpp index aba55716fc..be4a07f761 100644 --- a/generator/statistics.cpp +++ b/generator/statistics.cpp @@ -82,7 +82,7 @@ namespace stats void CalcStatistic(string const & fName, MapInfo & info) { AccumulateStatistic doProcess(info); - feature::ForEachFromDat(fName, doProcess); + feature::ForEachFromDat(new FileReader(fName), doProcess); } void PrintInfo(char const * prefix, GeneralInfo const & info) |