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

Function ParseLanes

libs/routing/lanes/lanes_parser.cpp:56–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54} // namespace
55
56LanesInfo ParseLanes(std::string_view lanesString)
57{
58 if (lanesString.empty())
59 return {};
60
61 LanesInfo lanes;
62 for (auto && laneInfo : lanesString | std::views::split('|'))
63 {
64 LaneInfo lane;
65 if (std::ranges::empty(laneInfo))
66 lane.laneWays.Add(LaneWay::None);
67 else
68 {
69 for (auto && laneWay : laneInfo | std::views::split(';'))
70 {
71 auto way = LaneWay::None;
72 auto && laneWayProcessed = laneWay | std::views::filter([](char const c) { return !std::isspace(c); }) |
73 std::views::transform([](char const c) { return std::tolower(c); });
74 if (!ParseSingleLane(laneWayProcessed, way))
75 return {};
76 lane.laneWays.Add(way);
77 if (way == LaneWay::ReverseLeft)
78 lane.laneWays.Add(LaneWay::ReverseRight);
79 }
80 }
81
82 lanes.push_back(lane);
83 }
84 return lanes;
85}
86} // namespace routing::turns::lanes

Callers 2

LoadLanesFunction · 0.85
UNIT_TESTFunction · 0.85

Calls 5

emptyFunction · 0.85
ParseSingleLaneFunction · 0.85
emptyMethod · 0.45
AddMethod · 0.45
push_backMethod · 0.45

Tested by 1

UNIT_TESTFunction · 0.68