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

Method ValidateAndFormat_panoramax

generator/osm2meta.cpp:347–367  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

345}
346
347std::string MetadataTagProcessorImpl::ValidateAndFormat_panoramax(std::string v)
348{
349 static auto const s_panoramaxRegex = std::regex(R"(^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$)");
350
351 if (std::regex_match(v, s_panoramaxRegex))
352 return v;
353 url::Url const parsedUrl = url::Url::FromString(v);
354 if (std::string const * paramValue = parsedUrl.GetParamValue("pic"))
355 {
356 if (std::regex_match(*paramValue, s_panoramaxRegex))
357 {
358 if (std::string const * xyzValue = parsedUrl.GetParamValue("xyz"))
359 {
360 return *paramValue + "&xyz=" + *xyzValue;
361 }
362 return *paramValue;
363 }
364 }
365 LOG(LDEBUG, ("Invalid Panoramax tag value:", v));
366 return {};
367}
368
369std::string MetadataTagProcessorImpl::ValidateAndFormat_rooms(std::string const & v)
370{

Callers

nothing calls this directly

Calls 2

GetParamValueMethod · 0.80
FromStringFunction · 0.70

Tested by

no test coverage detected