Static Public Member Functions
strconv_pcdata_impl< opt_trim, opt_eol, opt_escape > Struct Template Reference

List of all members.

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 1969 of file pugixml.cpp.


Member Function Documentation

template<typename opt_trim , typename opt_eol , typename opt_escape >
static char_t* strconv_pcdata_impl< opt_trim, opt_eol, opt_escape >::parse ( char_t *  s) [inline, static]

Definition at line 1971 of file pugixml.cpp.

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

                {
                        gap g;

                        char_t* begin = s;

                        while (true)
                        {
                                PUGI__SCANWHILE_UNROLL(!PUGI__IS_CHARTYPE(*s, ct_parse_pcdata));

                                if (*s == '<') // PCDATA ends here
                                {
                                        char_t* end = g.flush(s);

                                        if (opt_trim::value)
                                                while (end > begin && PUGI__IS_CHARTYPE(end[-1], ct_space))
                                                        --end;

                                        *end = 0;
                                        
                                        return s + 1;
                                }
                                else if (opt_eol::value && *s == '\r') // Either a single 0x0d or 0x0d 0x0a pair
                                {
                                        *s++ = '\n'; // replace first one with 0x0a
                                        
                                        if (*s == '\n') g.push(s, 1);
                                }
                                else if (opt_escape::value && *s == '&')
                                {
                                        s = strconv_escape(s, g);
                                }
                                else if (*s == 0)
                                {
                                        char_t* end = g.flush(s);

                                        if (opt_trim::value)
                                                while (end > begin && PUGI__IS_CHARTYPE(end[-1], ct_space))
                                                        --end;

                                        *end = 0;

                                        return s;
                                }
                                else ++s;
                        }
                }

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

Generated on Mon Sep 15 2014 01:23:55 for QuickFIX by doxygen 1.7.6.1 written by Dimitri van Heesch, © 1997-2001