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

Function FromString

generator/restriction_collector.cpp:315–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

313}
314
315void FromString(std::string_view str, Restriction::Type & type)
316{
317 if (str == kNo)
318 {
319 type = Restriction::Type::No;
320 return;
321 }
322
323 if (str == kOnly)
324 {
325 type = Restriction::Type::Only;
326 return;
327 }
328
329 if (str == kNoUTurn)
330 {
331 type = Restriction::Type::NoUTurn;
332 return;
333 }
334
335 if (str == kOnlyUTurn)
336 {
337 type = Restriction::Type::OnlyUTurn;
338 return;
339 }
340
341 CHECK(false, ("Invalid line:", str, "expected:", kNo, "or", kOnly, "or", kNoUTurn, "or", kOnlyUTurn));
342 UNREACHABLE();
343}
344
345void FromString(std::string_view str, RestrictionWriter::ViaType & type)
346{

Callers 2

ParseRestrictionsMethod · 0.70

Calls 1

to_doubleFunction · 0.50

Tested by

no test coverage detected