MCPcopy Create free account
hub / github.com/Tencent/rapidjson / WriteEscapedText

Method WriteEscapedText

example/jsonx/jsonx.cpp:118–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116 }
117
118 bool WriteEscapedText(const char* s, size_t length) {
119 for (size_t i = 0; i < length; i++) {
120 switch (s[i]) {
121 case '&': WriteString("&amp;"); break;
122 case '<': WriteString("&lt;"); break;
123 default: os_.Put(s[i]); break;
124 }
125 }
126 return true;
127 }
128
129 bool WriteStartElement(const char* type, bool emptyElement = false) {
130 if (level_ == 0)

Callers

nothing calls this directly

Calls 1

PutMethod · 0.45

Tested by

no test coverage detected