XML Parser Callbacks
| 266 | |
| 267 | // XML Parser Callbacks |
| 268 | static void startElement(void* userData, const char* name, const char** atts) { |
| 269 | auto me = static_cast<UserData*>(userData); |
| 270 | // for ( int i = 0 ; i < me->indent ; i++ ) printf(" "); |
| 271 | // printf("begin %s\n",name); |
| 272 | me->bTime = strcmp(name, "time") == 0; |
| 273 | me->bEle = strcmp(name, "ele") == 0; |
| 274 | |
| 275 | if (strcmp(name, "trkpt") == 0) { |
| 276 | me->nTrkpt++; |
| 277 | while (*atts) { |
| 278 | const char* a = atts[0]; |
| 279 | const char* v = atts[1]; |
| 280 | if (!strcmp(a, "lat")) |
| 281 | me->lat = atof(v); |
| 282 | if (!strcmp(a, "lon")) |
| 283 | me->lon = atof(v); |
| 284 | atts += 2; |
| 285 | } |
| 286 | } |
| 287 | me->count++; |
| 288 | me->indent++; |
| 289 | } |
| 290 | |
| 291 | static void endElement(void* userData, const char* name) { |
| 292 | auto me = static_cast<UserData*>(userData); |
nothing calls this directly
no outgoing calls
no test coverage detected