Welcome to mirror list, hosted at ThFree Co, Russian Federation.

speed_camera_prohibition.cpp « routing - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bf3f26df0ceb179f43d80e18e0d0230b1c947be4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "routing/speed_camera_prohibition.hpp"

#include "base/string_utils.hpp"

#include <algorithm>
#include <vector>

namespace
{
// List of country names where mwm should be generated without speed cameras.
std::vector<std::string> kSpeedCamerasProhibitedCountries = {
    "Cyprus", "Macedonia", "Switzerland", "Turkey",
};

// List of country names where an end user should be warned about speed cameras.
std::vector<std::string> kSpeedCamerasPartlyProhibitedCountries = {
    "France", "Germany",
};

bool IsMwmContained(platform::CountryFile const & mwm, std::vector<std::string> const & countryList)
{
  return std::any_of(countryList.cbegin(), countryList.cend(), [&mwm](auto const & country) {
    return strings::StartsWith(mwm.GetName(), country);
  });
}
}  // namespace

namespace routing
{
bool AreSpeedCamerasProhibited(platform::CountryFile const & mwm)
{
  return IsMwmContained(mwm, kSpeedCamerasProhibitedCountries);
}

bool AreSpeedCamerasPartlyProhibited(platform::CountryFile const & mwm)
{
  return IsMwmContained(mwm, kSpeedCamerasPartlyProhibitedCountries);
}
} // namespace routing