diff --git a/coding/zip_reader.cpp b/coding/zip_reader.cpp index 427048a903..04f733bd5c 100644 --- a/coding/zip_reader.cpp +++ b/coding/zip_reader.cpp @@ -40,9 +40,10 @@ private: }; } // namespace -ZipFileReader::ZipFileReader(string const & container, string const & file, - uint32_t logPageSize, uint32_t logPageCount) - : FileReader(container, logPageSize, logPageCount), m_uncompressedFileSize(0) +ZipFileReader::ZipFileReader(string const & container, string const & file, uint32_t logPageSize, + uint32_t logPageCount) + : FileReader(container, true /* withExceptions */, logPageSize, logPageCount) + , m_uncompressedFileSize(0) { unzFile zip = unzOpen64(container.c_str()); if (!zip) diff --git a/generator/cities_boundaries_builder.cpp b/generator/cities_boundaries_builder.cpp index 5205d927c2..33373cfaed 100644 --- a/generator/cities_boundaries_builder.cpp +++ b/generator/cities_boundaries_builder.cpp @@ -181,7 +181,7 @@ bool DeserializeBoundariesTable(std::string const & path, OsmIdToBoundariesTable try { - FileReader reader(path); + FileReader reader(path, true /* with exceptions */); NonOwningReaderSource source(reader); double precision; diff --git a/generator/gen_mwm_info.hpp b/generator/gen_mwm_info.hpp index 0eae92cfd1..6861bd79a8 100644 --- a/generator/gen_mwm_info.hpp +++ b/generator/gen_mwm_info.hpp @@ -74,7 +74,7 @@ public: { try { - FileReader reader(filename); + FileReader reader(filename, true /* with exceptions */); NonOwningReaderSource src(reader); Read(src); } diff --git a/generator/locality_sorter.cpp b/generator/locality_sorter.cpp index 7bc547e8b2..4c4b00c46f 100644 --- a/generator/locality_sorter.cpp +++ b/generator/locality_sorter.cpp @@ -210,7 +210,7 @@ bool GenerateLocalityDataImpl(FeaturesCollector & collector, NeedSerialize const // Sort features by their middle point. midPoints.Sort(); - FileReader reader(file); + FileReader reader(file, true /* with exceptions */); for (auto const & point : midPoints.GetVector()) { ReaderSource src(reader); diff --git a/generator/search_index_builder.cpp b/generator/search_index_builder.cpp index 6df7481c7a..c89ec54b62 100644 --- a/generator/search_index_builder.cpp +++ b/generator/search_index_builder.cpp @@ -444,7 +444,7 @@ bool BuildSearchIndexFromDataFile(string const & filename, bool forceRebuild) { FilesContainerW writeContainer(readContainer.GetFileName(), FileWriter::OP_WRITE_EXISTING); FileWriter writer = writeContainer.GetWriter(SEARCH_INDEX_FILE_TAG); - rw_ops::Reverse(FileReader(indexFilePath), writer); + rw_ops::Reverse(FileReader(indexFilePath, true /* with exceptions */), writer); } { diff --git a/generator/utils.hpp b/generator/utils.hpp index 1fb454bf2f..aabd800028 100644 --- a/generator/utils.hpp +++ b/generator/utils.hpp @@ -43,7 +43,7 @@ bool ForEachOsmId2FeatureId(std::string const & path, ToDo && toDo) gen::OsmID2FeatureID mapping; try { - FileReader reader(path); + FileReader reader(path, true /* with exceptions */); NonOwningReaderSource source(reader); mapping.Read(source); } diff --git a/kml/kml_tests/serdes_tests.cpp b/kml/kml_tests/serdes_tests.cpp index 90b6f5f6a9..64eafc8203 100644 --- a/kml/kml_tests/serdes_tests.cpp +++ b/kml/kml_tests/serdes_tests.cpp @@ -518,7 +518,7 @@ UNIT_TEST(Kml_Deserialization_Text_File) try { kml::DeserializerKml des(dataFromFile); - FileReader reader(kmlFile); + FileReader reader(kmlFile, true /* with exceptions */); des.Deserialize(reader); } catch (FileReader::Exception const & exc) @@ -555,7 +555,7 @@ UNIT_TEST(Kml_Deserialization_Bin_File) try { kml::binary::DeserializerKml des(dataFromFile); - FileReader reader(kmbFile); + FileReader reader(kmbFile, true /* with exceptions */); des.Deserialize(reader); } catch (FileReader::Exception const & exc) @@ -596,7 +596,7 @@ UNIT_TEST(Kml_Serialization_Bin_File) try { kml::binary::DeserializerKml des(dataFromFile); - FileReader reader(kmbFile); + FileReader reader(kmbFile, true /* with exceptions */); des.Deserialize(reader); } catch (FileReader::Exception const & exc) @@ -647,7 +647,7 @@ UNIT_TEST(Kml_Serialization_Text_File) try { kml::DeserializerKml des(dataFromFile); - FileReader reader(kmlFile); + FileReader reader(kmlFile, true /* with exceptions */); des.Deserialize(reader); } catch (FileReader::Exception const & exc) diff --git a/map/cloud.cpp b/map/cloud.cpp index 6614784d42..be0a162e11 100644 --- a/map/cloud.cpp +++ b/map/cloud.cpp @@ -304,7 +304,7 @@ Cloud::SnapshotResponseData ReadSnapshotFile(std::string const & filename) std::string jsonStr; try { - FileReader r(filename); + FileReader r(filename, true /* with exceptions */); r.ReadAsString(jsonStr); } catch (FileReader::Exception const & exception) @@ -458,7 +458,7 @@ bool Cloud::ReadIndex() std::string jsonStr; try { - FileReader r(indexFilePath); + FileReader r(indexFilePath, true /* with exceptions */); r.ReadAsString(jsonStr); } catch (FileReader::Exception const & exception) diff --git a/platform/chunks_download_strategy.cpp b/platform/chunks_download_strategy.cpp index 3aa1bad155..9632b74acc 100644 --- a/platform/chunks_download_strategy.cpp +++ b/platform/chunks_download_strategy.cpp @@ -83,15 +83,15 @@ void ChunksDownloadStrategy::SaveChunks(int64_t fileSize, string const & fName) (void)FileWriter::DeleteFileX(fName); } -int64_t ChunksDownloadStrategy::LoadOrInitChunks( string const & fName, - int64_t fileSize, int64_t chunkSize) +int64_t ChunksDownloadStrategy::LoadOrInitChunks(string const & fName, int64_t fileSize, + int64_t chunkSize) { ASSERT ( fileSize > 0, () ); ASSERT ( chunkSize > 0, () ); try { - FileReader r(fName); + FileReader r(fName, true /* with exceptions */); ReaderSource src(r); int64_t const readedSize = ReadVarInt(src); diff --git a/platform/downloader_tests/downloader_test.cpp b/platform/downloader_tests/downloader_test.cpp index 2a7a8235b1..c2c16c4d03 100644 --- a/platform/downloader_tests/downloader_test.cpp +++ b/platform/downloader_tests/downloader_test.cpp @@ -336,7 +336,7 @@ namespace { try { - FileReader f(file); + FileReader f(file, true /* withExceptions */); string s; f.ReadAsString(s); return s; diff --git a/platform/platform_android.cpp b/platform/platform_android.cpp index dc19c31d78..30b0c9239c 100644 --- a/platform/platform_android.cpp +++ b/platform/platform_android.cpp @@ -151,7 +151,7 @@ unique_ptr Platform::GetReader(string const & file, string const & { string const path = m_writableDir + file; if (IsFileExistsByFullPath(path)) - return make_unique(path, logPageSize, logPageCount); + return make_unique(path, true /* withExceptions */, logPageSize, logPageCount); break; } @@ -159,13 +159,13 @@ unique_ptr Platform::GetReader(string const & file, string const & { string const path = m_settingsDir + file; if (IsFileExistsByFullPath(path)) - return make_unique(path, logPageSize, logPageCount); + return make_unique(path, true /* withExceptions */, logPageSize, logPageCount); break; } case FULL_PATH: if (IsFileExistsByFullPath(file)) - return make_unique(file, logPageSize, logPageCount); + return make_unique(file, true /* withExceptions */, logPageSize, logPageCount); break; case RESOURCE: diff --git a/platform/platform_ios.mm b/platform/platform_ios.mm index 5d30f542ac..abc569c28c 100644 --- a/platform/platform_ios.mm +++ b/platform/platform_ios.mm @@ -115,8 +115,8 @@ bool Platform::GetFileSizeByName(string const & fileName, uint64_t & size) const unique_ptr Platform::GetReader(string const & file, string const & searchScope) const { - return make_unique(ReadPathForFile(file, searchScope), READER_CHUNK_LOG_SIZE, - READER_CHUNK_LOG_COUNT); + return make_unique(ReadPathForFile(file, searchScope), true /* withExceptions */, + READER_CHUNK_LOG_SIZE, READER_CHUNK_LOG_COUNT); } int Platform::VideoMemoryLimit() const { return 8 * 1024 * 1024; } diff --git a/platform/platform_tizen.cpp b/platform/platform_tizen.cpp index a116a6acd0..6e16c4e75b 100644 --- a/platform/platform_tizen.cpp +++ b/platform/platform_tizen.cpp @@ -74,7 +74,9 @@ void Platform::RunOnGuiThread(TFunctor const & fn) ModelReader * Platform::GetReader(string const & file, string const & searchScope) const { return new FileReader(ReadPathForFile(file, searchScope), - READER_CHUNK_LOG_SIZE, READER_CHUNK_LOG_COUNT); + true /* withExceptions */ + READER_CHUNK_LOG_SIZE, + READER_CHUNK_LOG_COUNT); } void Platform::GetFilesByRegExp(string const & directory, string const & regexp, FilesList & res) diff --git a/platform/string_storage_base.cpp b/platform/string_storage_base.cpp index e6075f5104..a1f430462e 100644 --- a/platform/string_storage_base.cpp +++ b/platform/string_storage_base.cpp @@ -24,7 +24,7 @@ StringStorageBase::StringStorageBase(string const & path) : m_path(path) try { LOG(LINFO, ("Settings path:", m_path)); - ReaderStreamBuf buffer(make_unique(m_path)); + ReaderStreamBuf buffer(make_unique(m_path, true /* withExceptions */)); istream stream(&buffer); string line; diff --git a/ugc/storage.cpp b/ugc/storage.cpp index f602560c21..6d49985487 100644 --- a/ugc/storage.cpp +++ b/ugc/storage.cpp @@ -194,7 +194,7 @@ void Storage::Load() auto const indexFilePath = GetIndexFilePath(); try { - FileReader r(indexFilePath); + FileReader r(indexFilePath, true /* with exceptions */); r.ReadAsString(data); } catch (FileReader::Exception const & exception) @@ -424,7 +424,7 @@ size_t GetNumberOfUnsentUGC() string data; try { - FileReader r(indexFilePath); + FileReader r(indexFilePath, true /* with exceptions */); r.ReadAsString(data); } catch (FileReader::Exception const & exception)