diff options
author | Maxim Pimenov <m@maps.me> | 2018-06-14 16:33:04 +0300 |
---|---|---|
committer | Arsentiy Milchakov <milcars@mapswithme.com> | 2018-06-21 15:05:58 +0300 |
commit | 222a75ff67e65a31058ba63136d4b2b3c9ce8591 (patch) | |
tree | e86751a0ca504894acae70b20df6f9bf5b5d2490 /track_analyzing | |
parent | 1728f1af3df2f6c927c88085845353f2c7c19f73 (diff) |
[coding] FileReader now always throws exception on an out-of-bounds access.
Diffstat (limited to 'track_analyzing')
-rw-r--r-- | track_analyzing/track_analyzer/cmd_table.cpp | 4 | ||||
-rw-r--r-- | track_analyzing/track_analyzer/cmd_track.cpp | 4 | ||||
-rw-r--r-- | track_analyzing/utils.cpp | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/track_analyzing/track_analyzer/cmd_table.cpp b/track_analyzing/track_analyzer/cmd_table.cpp index 4fa130b228..a69d4a9429 100644 --- a/track_analyzing/track_analyzer/cmd_table.cpp +++ b/track_analyzing/track_analyzer/cmd_table.cpp @@ -15,6 +15,7 @@ #include "storage/storage.hpp" #include "coding/file_name_utils.hpp" +#include "coding/file_reader.hpp" #include <iostream> @@ -168,7 +169,8 @@ class MatchedTrackPointToMoveType final { public: MatchedTrackPointToMoveType(string const & mwmFile) - : m_featuresVector(FilesContainerR(make_unique<FileReader>(mwmFile))) + : m_featuresVector(FilesContainerR(make_unique<FileReader>( + mwmFile, FileReader::kDefaultLogPageSize, FileReader::kDefaultLogPageCount))) { } diff --git a/track_analyzing/track_analyzer/cmd_track.cpp b/track_analyzing/track_analyzer/cmd_track.cpp index a0bbea8e74..e1e5611388 100644 --- a/track_analyzing/track_analyzer/cmd_track.cpp +++ b/track_analyzing/track_analyzer/cmd_track.cpp @@ -13,6 +13,7 @@ #include "storage/storage.hpp" #include "coding/file_name_utils.hpp" +#include "coding/file_reader.hpp" #include "geometry/mercator.hpp" @@ -35,7 +36,8 @@ void CmdTrack(string const & trackFile, string const & mwmName, string const & u string const mwmFile = GetCurrentVersionMwmFile(storage, mwmName); shared_ptr<VehicleModelInterface> vehicleModel = CarModelFactory({}).GetVehicleModelForCountry(mwmName); - FeaturesVectorTest featuresVector(FilesContainerR(make_unique<FileReader>(mwmFile))); + FeaturesVectorTest featuresVector(FilesContainerR(make_unique<FileReader>( + mwmFile, FileReader::kDefaultLogPageSize, FileReader::kDefaultLogPageCount))); Geometry geometry(GeometryLoader::CreateFromFile(mwmFile, vehicleModel)); uint64_t const duration = diff --git a/track_analyzing/utils.cpp b/track_analyzing/utils.cpp index 1860f7064b..1ecdf43e51 100644 --- a/track_analyzing/utils.cpp +++ b/track_analyzing/utils.cpp @@ -52,7 +52,7 @@ double CalcSpeedKMpH(double meters, uint64_t secondsElapsed) void ReadTracks(shared_ptr<NumMwmIds> numMwmIds, string const & filename, MwmToMatchedTracks & mwmToMatchedTracks) { - FileReader reader(filename); + FileReader reader(filename, FileReader::kDefaultLogPageSize, FileReader::kDefaultLogPageCount); ReaderSource<FileReader> src(reader); MwmToMatchedTracksSerializer serializer(numMwmIds); serializer.Deserialize(mwmToMatchedTracks, src); |