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

Static Public Member Functions

static char_t * parse_wnorm (char_t *s, char_t end_quote)
static char_t * parse_wconv (char_t *s, char_t end_quote)
static char_t * parse_eol (char_t *s, char_t end_quote)
static char_t * parse_simple (char_t *s, char_t end_quote)

Detailed Description

template<typename opt_escape>
struct strconv_attribute_impl< opt_escape >

Definition at line 2745 of file pugixml.cc.

Member Function Documentation

◆ parse_eol()

template<typename opt_escape>
char_t * strconv_attribute_impl< opt_escape >::parse_eol ( char_t * s,
char_t end_quote )
inlinestatic

Definition at line 2835 of file pugixml.cc.

2836 {
2837 gap g;
2838
2839 while (true)
2840 {
2842
2843 if (*s == end_quote)
2844 {
2845 *g.flush(s) = 0;
2846
2847 return s + 1;
2848 }
2849 else if (*s == '\r')
2850 {
2851 *s++ = '\n';
2852
2853 if (*s == '\n') g.push(s, 1);
2854 }
2855 else if (opt_escape::value && *s == '&')
2856 {
2857 s = strconv_escape(s, g);
2858 }
2859 else if (!*s)
2860 {
2861 return 0;
2862 }
2863 else ++s;
2864 }
2865 }
#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_attribute().

◆ parse_simple()

template<typename opt_escape>
char_t * strconv_attribute_impl< opt_escape >::parse_simple ( char_t * s,
char_t end_quote )
inlinestatic

Definition at line 2867 of file pugixml.cc.

2868 {
2869 gap g;
2870
2871 while (true)
2872 {
2874
2875 if (*s == end_quote)
2876 {
2877 *g.flush(s) = 0;
2878
2879 return s + 1;
2880 }
2881 else if (opt_escape::value && *s == '&')
2882 {
2883 s = strconv_escape(s, g);
2884 }
2885 else if (!*s)
2886 {
2887 return 0;
2888 }
2889 else ++s;
2890 }
2891 }

Referenced by get_strconv_attribute().

◆ parse_wconv()

template<typename opt_escape>
char_t * strconv_attribute_impl< opt_escape >::parse_wconv ( char_t * s,
char_t end_quote )
inlinestatic

Definition at line 2799 of file pugixml.cc.

2800 {
2801 gap g;
2802
2803 while (true)
2804 {
2806
2807 if (*s == end_quote)
2808 {
2809 *g.flush(s) = 0;
2810
2811 return s + 1;
2812 }
2813 else if (PUGI__IS_CHARTYPE(*s, ct_space))
2814 {
2815 if (*s == '\r')
2816 {
2817 *s++ = ' ';
2818
2819 if (*s == '\n') g.push(s, 1);
2820 }
2821 else *s++ = ' ';
2822 }
2823 else if (opt_escape::value && *s == '&')
2824 {
2825 s = strconv_escape(s, g);
2826 }
2827 else if (!*s)
2828 {
2829 return 0;
2830 }
2831 else ++s;
2832 }
2833 }

Referenced by get_strconv_attribute().

◆ parse_wnorm()

template<typename opt_escape>
char_t * strconv_attribute_impl< opt_escape >::parse_wnorm ( char_t * s,
char_t end_quote )
inlinestatic

Definition at line 2747 of file pugixml.cc.

2748 {
2749 gap g;
2750
2751 // trim leading whitespaces
2753 {
2754 char_t* str = s;
2755
2756 do ++str;
2757 while (PUGI__IS_CHARTYPE(*str, ct_space));
2758
2759 g.push(s, str - s);
2760 }
2761
2762 while (true)
2763 {
2765
2766 if (*s == end_quote)
2767 {
2768 char_t* str = g.flush(s);
2769
2770 do *str-- = 0;
2771 while (PUGI__IS_CHARTYPE(*str, ct_space));
2772
2773 return s + 1;
2774 }
2775 else if (PUGI__IS_CHARTYPE(*s, ct_space))
2776 {
2777 *s++ = ' ';
2778
2780 {
2781 char_t* str = s + 1;
2782 while (PUGI__IS_CHARTYPE(*str, ct_space)) ++str;
2783
2784 g.push(s, str - s);
2785 }
2786 }
2787 else if (opt_escape::value && *s == '&')
2788 {
2789 s = strconv_escape(s, g);
2790 }
2791 else if (!*s)
2792 {
2793 return 0;
2794 }
2795 else ++s;
2796 }
2797 }

Referenced by get_strconv_attribute().


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