MCPcopy Create free account
hub / github.com/comaps/comaps / LoadSpeedCameraFromMwm

Function LoadSpeedCameraFromMwm

generator/generator_tests/speed_cameras_test.cpp:53–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51using CameraMapItem = std::pair<SegmentCoord, RouteSegment::SpeedCamera>;
52
53CameraMap LoadSpeedCameraFromMwm(string const & mwmFullPath)
54{
55 FilesContainerR const cont(mwmFullPath);
56 CHECK(cont.IsExist(CAMERAS_INFO_FILE_TAG), ("Cannot find", CAMERAS_INFO_FILE_TAG, "section"));
57
58 try
59 {
60 FilesContainerR::TReader const reader = cont.GetReader(CAMERAS_INFO_FILE_TAG);
61 ReaderSource<FilesContainerR::TReader> src(reader);
62
63 CameraMap result;
64 DeserializeSpeedCamsFromMwm(src, result);
65 return result;
66 }
67 catch (Reader::OpenException const & e)
68 {
69 TEST(false, ("Error while reading", CAMERAS_INFO_FILE_TAG, "section.", e.Msg()));
70 return {};
71 }
72}
73
74std::vector<CameraMapItem> UnpackMapToVector(CameraMap const & cameraMap)
75{

Callers 1

Calls 4

TESTFunction · 0.85
IsExistMethod · 0.80
GetReaderMethod · 0.45

Tested by

no test coverage detected