| 290 | namespace openlr |
| 291 | { |
| 292 | bool ParseOpenlr(pugi::xml_document const & document, vector<LinearSegment> & segments) |
| 293 | { |
| 294 | for (auto const segmentXpathNode : document.select_nodes("//reportSegments")) |
| 295 | { |
| 296 | LinearSegment segment; |
| 297 | auto const & node = segmentXpathNode.node(); |
| 298 | if (!IsLocationReferenceTag(node) && !IsCoordinatesTag(node)) |
| 299 | { |
| 300 | LOG(LWARNING, ("A segment with a strange tag. It is not <coordinates>" |
| 301 | " or <optionLinearLocationReference>, skipping...")); |
| 302 | continue; |
| 303 | } |
| 304 | |
| 305 | if (!SegmentFromXML(node, segment)) |
| 306 | return false; |
| 307 | |
| 308 | segments.push_back(segment); |
| 309 | } |
| 310 | return true; |
| 311 | } |
| 312 | |
| 313 | bool SegmentFromXML(pugi::xml_node const & segmentNode, LinearSegment & segment) |
| 314 | { |
no test coverage detected