3260 {
3263
3265 xml_node_struct* cursor = root;
3267
3268 while (*s != 0)
3269 {
3270 if (*s == '<')
3271 {
3272 ++s;
3273
3274 LOC_TAG:
3276 {
3278
3279 cursor->name = s;
3280
3283
3284 if (ch == '>')
3285 {
3286
3287 }
3289 {
3290 LOC_ATTRIBUTES:
3291 while (true)
3292 {
3294
3296 {
3299
3300 a->name = s;
3301
3304
3306 {
3308
3309 ch = *s;
3310 ++s;
3311 }
3312
3313 if (ch == '=')
3314 {
3316
3317 if (*s == '"' || *s == '\'')
3318 {
3319 ch = *s;
3320 ++s;
3321 a->value = s;
3322
3323 s = strconv_attribute(s, ch);
3324
3326
3327
3328
3329
3331 }
3333 }
3335 }
3336 else if (*s == '/')
3337 {
3338 ++s;
3339
3340 if (*s == '>')
3341 {
3343 s++;
3344 break;
3345 }
3346 else if (*s == 0 && endch == '>')
3347 {
3349 break;
3350 }
3352 }
3353 else if (*s == '>')
3354 {
3355 ++s;
3356
3357 break;
3358 }
3359 else if (*s == 0 && endch == '>')
3360 {
3361 break;
3362 }
3364 }
3365
3366
3367 }
3368 else if (ch == '/')
3369 {
3371
3373
3374 s += (*s == '>');
3375 }
3376 else if (ch == 0)
3377 {
3378
3379 --s;
3380
3382 }
3384 }
3385 else if (*s == '/')
3386 {
3387 ++s;
3388
3389 mark = s;
3390
3393
3395 {
3397 }
3398
3399 if (*name)
3400 {
3401 if (*s == 0 && name[0] == endch && name[1] == 0)
PUGI__THROW_ERROR(status_bad_end_element, s);
3403 }
3404
3406
3408
3409 if (*s == 0)
3410 {
3412 }
3413 else
3414 {
3416 ++s;
3417 }
3418 }
3419 else if (*s == '?')
3420 {
3422 if (!s) return s;
3423
3424 assert(cursor);
3425 if (
PUGI__NODETYPE(cursor) == node_declaration)
goto LOC_ATTRIBUTES;
3426 }
3427 else if (*s == '!')
3428 {
3430 if (!s) return s;
3431 }
3434 }
3435 else
3436 {
3437 mark = s;
3438
3440
3441 if (*s == '<' || !*s)
3442 {
3443
3444 assert(mark != s);
3445
3447 {
3448 continue;
3449 }
3451 {
3452 if (s[0] != '<' || s[1] != '/' || cursor->first_child) continue;
3453 }
3454 }
3455
3457 s = mark;
3458
3460 {
3461 if (
PUGI__OPTSET(parse_embed_pcdata) && cursor->parent && !cursor->first_child && !cursor->value)
3462 {
3463 cursor->value = s;
3464 }
3465 else
3466 {
3468
3469 cursor->value = s;
3470
3472 }
3473
3474 s = strconv_pcdata(s);
3475
3476 if (!*s) break;
3477 }
3478 else
3479 {
3481 if (!*s) break;
3482
3483 ++s;
3484 }
3485
3486
3487 goto LOC_TAG;
3488 }
3489 }
3490
3491
3493
3494 return s;
3495 }
const char * name(G4int ptype)
char_t *(* strconv_attribute_t)(char_t *, char_t)
#define PUGI__SCANWHILE_UNROLL(X)
PUGI__FN strconv_attribute_t get_strconv_attribute(unsigned int optmask)
PUGI__FN strconv_pcdata_t get_strconv_pcdata(unsigned int optmask)
PUGI__FN_NO_INLINE xml_attribute_struct * append_new_attribute(xml_node_struct *node, xml_allocator &alloc)
char_t *(* strconv_pcdata_t)(char_t *)
char_t * parse_question(char_t *s, xml_node_struct *&ref_cursor, unsigned int optmsk, char_t endch)
char_t * parse_exclamation(char_t *s, xml_node_struct *cursor, unsigned int optmsk, char_t endch)