Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
strconv_pcdata_impl< opt_trim, opt_eol, opt_escape > Struct Template Reference

Static Public Member Functions

static char_t * parse (char_t *s)

Detailed Description

template<typename opt_trim, typename opt_eol, typename opt_escape>
struct strconv_pcdata_impl< opt_trim, opt_eol, opt_escape >

Definition at line 2674 of file pugixml.cc.

Member Function Documentation

◆ parse()

template<typename opt_trim, typename opt_eol, typename opt_escape>
char_t * strconv_pcdata_impl< opt_trim, opt_eol, opt_escape >::parse ( char_t * s)
inlinestatic

Definition at line 2676 of file pugixml.cc.

2677 {
2678 gap g;
2679
2680 char_t* begin = s;
2681
2682 while (true)
2683 {
2685
2686 if (*s == '<') // PCDATA ends here
2687 {
2688 char_t* end = g.flush(s);
2689
2690 if (opt_trim::value)
2691 while (end > begin && PUGI__IS_CHARTYPE(end[-1], ct_space))
2692 --end;
2693
2694 *end = 0;
2695
2696 return s + 1;
2697 }
2698 else if (opt_eol::value && *s == '\r') // Either a single 0x0d or 0x0d 0x0a pair
2699 {
2700 *s++ = '\n'; // replace first one with 0x0a
2701
2702 if (*s == '\n') g.push(s, 1);
2703 }
2704 else if (opt_escape::value && *s == '&')
2705 {
2706 s = strconv_escape(s, g);
2707 }
2708 else if (*s == 0)
2709 {
2710 char_t* end = g.flush(s);
2711
2712 if (opt_trim::value)
2713 while (end > begin && PUGI__IS_CHARTYPE(end[-1], ct_space))
2714 --end;
2715
2716 *end = 0;
2717
2718 return s;
2719 }
2720 else ++s;
2721 }
2722 }
#define PUGI__SCANWHILE_UNROLL(X)
Definition pugixml.cc:2611
#define PUGI__IS_CHARTYPE(c, ct)
Definition pugixml.cc:1915
PUGI__FN char_t * strconv_escape(char_t *s, gap &g)
Definition pugixml.cc:2463

Referenced by get_strconv_pcdata().


The documentation for this struct was generated from the following file: