From 9af993a4861033353f2c7ca2de7f9108f391a6fb Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Tue, 23 Aug 2011 17:04:34 +0300 Subject: [generator_tool] -calc_statistics works even if some section is missing in the mwm file --- generator/statistics.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'generator/statistics.cpp') diff --git a/generator/statistics.cpp b/generator/statistics.cpp index ba386c5e2e..2af867fe7d 100644 --- a/generator/statistics.cpp +++ b/generator/statistics.cpp @@ -9,6 +9,7 @@ #include "../base/string_utils.hpp" #include "../std/iostream.hpp" +#include "../std/iomanip.hpp" #include "../base/start_mem_debug.hpp" @@ -36,7 +37,17 @@ namespace stats tags.push_back(SEARCH_INDEX_FILE_TAG); for (size_t i = 0; i < tags.size(); ++i) - cout << tags[i] << " : " << cont.GetReader(tags[i]).Size() << endl; + { + cout << setw(7) << tags[i] << " : "; + try + { + cout << cont.GetReader(tags[i]).Size() << endl; + } + catch (Reader::Exception const &) + { + cout << '-' << endl; + } + } } class AccumulateStatistic -- cgit v1.2.3