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
| ) |  |

inline static

Definition at line 2130 of file pugixml.cpp.

{
gap g;
while (true)
{
PUGI__SCANWHILE_UNROLL(!PUGI__IS_CHARTYPE(*s, ct_parse_attr));
if (*s == end_quote)
{
*g.flush(s) = 0;
return s + 1;
}
else if (*s == '\r')
{
*s++ = '\n';
if (*s == '\n') g.push(s, 1);
}
else if (opt_escape::value && *s == '&')
{
s = strconv_escape(s, g);
}
else if (!*s)
{
return 0;
}
else ++s;
}
}
PUGI__SCANWHILE_UNROLL
#define PUGI__SCANWHILE_UNROLL(X)
Definition pugixml.cpp:1906
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_parse_attr
@ ct_parse_attr
Definition pugixml.cpp:1128
gap
Definition pugixml.cpp:1717
gap::flush
char_t * flush(char_t *s)
Definition pugixml.cpp:1744
gap::push
void push(char_t *&s, size_t count)
Definition pugixml.cpp:1727

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
| ) |  |

inline static

Definition at line 2162 of file pugixml.cpp.

{
gap g;
while (true)
{
PUGI__SCANWHILE_UNROLL(!PUGI__IS_CHARTYPE(*s, ct_parse_attr));
if (*s == end_quote)
{
*g.flush(s) = 0;
return s + 1;
}
else if (opt_escape::value && *s == '&')
{
s = strconv_escape(s, g);
}
else if (!*s)
{
return 0;
}
else ++s;
}
}

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
| ) |  |

inline static

Definition at line 2094 of file pugixml.cpp.

{
gap g;
while (true)
{
PUGI__SCANWHILE_UNROLL(!PUGI__IS_CHARTYPE(*s, ct_parse_attr_ws));
if (*s == end_quote)
{
*g.flush(s) = 0;
return s + 1;
}
else if (PUGI__IS_CHARTYPE(*s, ct_space))
{
if (*s == '\r')
{
*s++ = ' ';
if (*s == '\n') g.push(s, 1);
}
else *s++ = ' ';
}
else if (opt_escape::value && *s == '&')
{
s = strconv_escape(s, g);
}
else if (!*s)
{
return 0;
}
else ++s;
}
}
ct_parse_attr_ws
@ ct_parse_attr_ws
Definition pugixml.cpp:1129
ct_space
@ ct_space
Definition pugixml.cpp:1130

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
| ) |  |

inline static

Definition at line 2042 of file pugixml.cpp.

{
gap g;
// trim leading whitespaces
if (PUGI__IS_CHARTYPE(*s, ct_space))
{
char_t* str = s;
do ++str;
while (PUGI__IS_CHARTYPE(*str, ct_space));
g.push(s, str - s);
}
while (true)
{
PUGI__SCANWHILE_UNROLL(!PUGI__IS_CHARTYPE(*s, ct_parse_attr_ws | ct_space));
if (*s == end_quote)
{
char_t* str = g.flush(s);
do *str-- = 0;
while (PUGI__IS_CHARTYPE(*str, ct_space));
return s + 1;
}
else if (PUGI__IS_CHARTYPE(*s, ct_space))
{
*s++ = ' ';
if (PUGI__IS_CHARTYPE(*s, ct_space))
{
char_t* str = s + 1;
while (PUGI__IS_CHARTYPE(*str, ct_space)) ++str;
g.push(s, str - s);
}
}
else if (opt_escape::value && *s == '&')
{
s = strconv_escape(s, g);
}
else if (!*s)
{
return 0;
}
else ++s;
}
}

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:

- pugixml.cpp