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

router.cpp « routing - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: eb3dc93e79b30875c5d095237fac0793f7d6764e (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
#include "router.hpp"

namespace routing
{

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";
  }
  ASSERT(false, ());
  return "Error";
}

RouterType FromString(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;

  ASSERT(false, ("Incorrect routing string:", str));
  return RouterType::Vehicle;
}
} //  namespace routing