| 158 | } |
| 159 | |
| 160 | bool PathPropertiesFromXML(pugi::xml_node const & locPointNode, openlr::LocationReferencePoint & locPoint) |
| 161 | { |
| 162 | // Last point does not contain path properties. |
| 163 | if (strcmp(locPointNode.name(), "olr:last") == 0) |
| 164 | return true; |
| 165 | |
| 166 | auto const propNode = locPointNode.child("olr:pathProperties"); |
| 167 | if (!propNode) |
| 168 | { |
| 169 | LOG(LERROR, ("Can't parse path properties")); |
| 170 | return false; |
| 171 | } |
| 172 | |
| 173 | if (!ValueFromXML(propNode.child("olr:dnp"), locPoint.m_distanceToNextPoint)) |
| 174 | { |
| 175 | LOG(LERROR, ("Can't parse dnp")); |
| 176 | return false; |
| 177 | } |
| 178 | |
| 179 | if (!TableValueFromXML(propNode.child("olr:lfrcnp"), locPoint.m_lfrcnp)) |
| 180 | { |
| 181 | LOG(LERROR, ("Can't parse lfrcnp")); |
| 182 | return false; |
| 183 | } |
| 184 | |
| 185 | auto const directionNode = propNode.child("olr:againstDrivingDirection"); |
| 186 | if (!directionNode) |
| 187 | { |
| 188 | LOG(LERROR, ("Can't parse driving direction")); |
| 189 | return false; |
| 190 | } |
| 191 | locPoint.m_againstDrivingDirection = directionNode.text().as_bool(); |
| 192 | |
| 193 | return true; |
| 194 | } |
| 195 | |
| 196 | bool LocationReferencePointFromXML(pugi::xml_node const & locPointNode, openlr::LocationReferencePoint & locPoint) |
| 197 | { |
no test coverage detected