Static Public Member Functions | List of all members
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 2040 of file pugixml.cpp.

Member Function Documentation

◆ parse_eol()

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

Definition at line 2130 of file pugixml.cpp.

2131  {
2132  gap g;
2133 
2134  while (true)
2135  {
2137 
2138  if (*s == end_quote)
2139  {
2140  *g.flush(s) = 0;
2141 
2142  return s + 1;
2143  }
2144  else if (*s == '\r')
2145  {
2146  *s++ = '\n';
2147 
2148  if (*s == '\n') g.push(s, 1);
2149  }
2150  else if (opt_escape::value && *s == '&')
2151  {
2152  s = strconv_escape(s, g);
2153  }
2154  else if (!*s)
2155  {
2156  return 0;
2157  }
2158  else ++s;
2159  }
2160  }

References ct_parse_attr, gap::flush(), PUGI__IS_CHARTYPE, PUGI__SCANWHILE_UNROLL, gap::push(), and strconv_escape().

◆ parse_simple()

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

Definition at line 2162 of file pugixml.cpp.

2163  {
2164  gap g;
2165 
2166  while (true)
2167  {
2169 
2170  if (*s == end_quote)
2171  {
2172  *g.flush(s) = 0;
2173 
2174  return s + 1;
2175  }
2176  else if (opt_escape::value && *s == '&')
2177  {
2178  s = strconv_escape(s, g);
2179  }
2180  else if (!*s)
2181  {
2182  return 0;
2183  }
2184  else ++s;
2185  }
2186  }

References ct_parse_attr, gap::flush(), PUGI__IS_CHARTYPE, PUGI__SCANWHILE_UNROLL, and strconv_escape().

◆ parse_wconv()

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

Definition at line 2094 of file pugixml.cpp.

2095  {
2096  gap g;
2097 
2098  while (true)
2099  {
2101 
2102  if (*s == end_quote)
2103  {
2104  *g.flush(s) = 0;
2105 
2106  return s + 1;
2107  }
2108  else if (PUGI__IS_CHARTYPE(*s, ct_space))
2109  {
2110  if (*s == '\r')
2111  {
2112  *s++ = ' ';
2113 
2114  if (*s == '\n') g.push(s, 1);
2115  }
2116  else *s++ = ' ';
2117  }
2118  else if (opt_escape::value && *s == '&')
2119  {
2120  s = strconv_escape(s, g);
2121  }
2122  else if (!*s)
2123  {
2124  return 0;
2125  }
2126  else ++s;
2127  }
2128  }

References ct_parse_attr_ws, ct_space, gap::flush(), PUGI__IS_CHARTYPE, PUGI__SCANWHILE_UNROLL, gap::push(), and strconv_escape().

◆ parse_wnorm()

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

Definition at line 2042 of file pugixml.cpp.

2043  {
2044  gap g;
2045 
2046  // trim leading whitespaces
2047  if (PUGI__IS_CHARTYPE(*s, ct_space))
2048  {
2049  char_t* str = s;
2050 
2051  do ++str;
2052  while (PUGI__IS_CHARTYPE(*str, ct_space));
2053 
2054  g.push(s, str - s);
2055  }
2056 
2057  while (true)
2058  {
2060 
2061  if (*s == end_quote)
2062  {
2063  char_t* str = g.flush(s);
2064 
2065  do *str-- = 0;
2066  while (PUGI__IS_CHARTYPE(*str, ct_space));
2067 
2068  return s + 1;
2069  }
2070  else if (PUGI__IS_CHARTYPE(*s, ct_space))
2071  {
2072  *s++ = ' ';
2073 
2074  if (PUGI__IS_CHARTYPE(*s, ct_space))
2075  {
2076  char_t* str = s + 1;
2077  while (PUGI__IS_CHARTYPE(*str, ct_space)) ++str;
2078 
2079  g.push(s, str - s);
2080  }
2081  }
2082  else if (opt_escape::value && *s == '&')
2083  {
2084  s = strconv_escape(s, g);
2085  }
2086  else if (!*s)
2087  {
2088  return 0;
2089  }
2090  else ++s;
2091  }
2092  }

References ct_parse_attr_ws, ct_space, gap::flush(), PUGI__IS_CHARTYPE, PUGI__SCANWHILE_UNROLL, gap::push(), and strconv_escape().


The documentation for this struct was generated from the following file:
PUGI__IS_CHARTYPE
#define PUGI__IS_CHARTYPE(c, ct)
Definition: pugixml.cpp:1195
strconv_escape
PUGI__FN char_t * strconv_escape(char_t *s, gap &g)
Definition: pugixml.cpp:1758
ct_space
@ ct_space
Definition: pugixml.cpp:1130
ct_parse_attr_ws
@ ct_parse_attr_ws
Definition: pugixml.cpp:1129
ct_parse_attr
@ ct_parse_attr
Definition: pugixml.cpp:1128
gap::push
void push(char_t *&s, size_t count)
Definition: pugixml.cpp:1727
gap::flush
char_t * flush(char_t *s)
Definition: pugixml.cpp:1744
PUGI__SCANWHILE_UNROLL
#define PUGI__SCANWHILE_UNROLL(X)
Definition: pugixml.cpp:1906
gap
Definition: pugixml.cpp:1716

Generated on Wed Apr 29 2020 19:41:30 for QuickFIX by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2001