blob: 4135cfc84fa405861e53978ed0f197cf4f6f73ab (
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
|
#include "routing/router.hpp"
namespace routing
{
std::string ToString(RouterType type)
{
switch(type)
{
case RouterType::Vehicle: return "vehicle";
case RouterType::Pedestrian: return "pedestrian";
case RouterType::Bicycle: return "bicycle";
case RouterType::Taxi: return "taxi";
case RouterType::Transit: return "transit";
case RouterType::Count: return "count";
}
ASSERT(false, ());
return "Error";
}
RouterType FromString(std::string const & str)
{
if (str == "vehicle")
return RouterType::Vehicle;
if (str == "pedestrian")
return RouterType::Pedestrian;
if (str == "bicycle")
return RouterType::Bicycle;
if (str == "taxi")
return RouterType::Taxi;
if (str == "transit")
return RouterType::Transit;
ASSERT(false, ("Incorrect routing string:", str));
return RouterType::Vehicle;
}
std::string DebugPrint(RouterType type) { return ToString(type); }
} // namespace routing
|