MCPcopy Create free account
hub / github.com/awslabs/aws-lambda-cpp / OutputXmlCDataSection

Method OutputXmlCDataSection

tests/gtest/gtest-all.cc:5198–5215  ·  view source on GitHub ↗

Streams an XML CDATA section, escaping invalid CDATA sequences as needed.

Source from the content-addressed store, hash-verified

5196
5197// Streams an XML CDATA section, escaping invalid CDATA sequences as needed.
5198void XmlUnitTestResultPrinter::OutputXmlCDataSection(::std::ostream* stream,
5199 const char* data) {
5200 const char* segment = data;
5201 *stream << "<![CDATA[";
5202 for (;;) {
5203 const char* const next_segment = strstr(segment, "]]>");
5204 if (next_segment != nullptr) {
5205 stream->write(
5206 segment, static_cast<std::streamsize>(next_segment - segment));
5207 *stream << "]]>]]&gt;<![CDATA[";
5208 segment = next_segment + strlen("]]>");
5209 } else {
5210 *stream << segment;
5211 break;
5212 }
5213 }
5214 *stream << "]]>";
5215}
5216
5217void XmlUnitTestResultPrinter::OutputXmlAttribute(
5218 std::ostream* stream,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected