gap Struct Reference

## Public Member Functions

| gap ()
void | push (char_t *&s, size_t count)
char_t * | flush (char_t *s)

## Public Attributes

char_t * | end
size_t | size

## Detailed Description

Definition at line 1716 of file pugixml.cpp.

## Constructor & Destructor Documentation

## gap()

gap::gap | ( |  | ) |

inline

Definition at line 1721 of file pugixml.cpp.

: end(0), size(0)
{
}
gap::end
char_t * end
Definition: pugixml.cpp:1718
gap::size
size_t size
Definition: pugixml.cpp:1719

## Member Function Documentation

## flush()

char_t* gap::flush | ( | char_t * | s | ) |

inline

Definition at line 1744 of file pugixml.cpp.

{
if (end)
{
// Move [old_gap_end, current_pos) to [old_gap_start, ...)
assert(s >= end);
memmove(end - size, end, reinterpret_cast<char*>(s) - reinterpret_cast<char*>(end));
return s - size;
}
else return s;
}

References end, and size.

Referenced by strconv_pcdata_impl< opt_trim, opt_eol, opt_escape >::parse(), strconv_attribute_impl< opt_escape >::parse_eol(), strconv_attribute_impl< opt_escape >::parse_simple(), strconv_attribute_impl< opt_escape >::parse_wconv(), strconv_attribute_impl< opt_escape >::parse_wnorm(), strconv_cdata(), and strconv_comment().

## push()

void gap::push | ( | char_t *& | s,
|  | size_t | count
| ) |  |

inline

Definition at line 1727 of file pugixml.cpp.

{
if (end) // there was a gap already; collapse it
{
// Move [old_gap_end, new_gap_start) to [old_gap_start, ...)
assert(s >= end);
memmove(end - size, end, reinterpret_cast<char*>(s) - reinterpret_cast<char*>(end));
}
s += count; // end of current gap
// "merge" two gaps
end = s;
size += count;
}

References end, and size.

Referenced by strconv_pcdata_impl< opt_trim, opt_eol, opt_escape >::parse(), strconv_attribute_impl< opt_escape >::parse_eol(), strconv_attribute_impl< opt_escape >::parse_wconv(), strconv_attribute_impl< opt_escape >::parse_wnorm(), strconv_cdata(), strconv_comment(), and strconv_escape().

## Member Data Documentation

## end

char_t* gap::end

Definition at line 1718 of file pugixml.cpp.

Referenced by flush(), and push().

## size

size_t gap::size

Definition at line 1719 of file pugixml.cpp.

Referenced by flush(), and push().

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

- pugixml.cpp