MCPcopy Create free account
hub / github.com/apache/trafficserver / WriteCodePoint

Function WriteCodePoint

lib/yamlcpp/src/emitterutils.cpp:134–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132}
133
134void WriteCodePoint(ostream_wrapper& out, int codePoint) {
135 if (codePoint < 0 || codePoint > 0x10FFFF) {
136 codePoint = REPLACEMENT_CHARACTER;
137 }
138 if (codePoint <= 0x7F) {
139 out << static_cast<char>(codePoint);
140 } else if (codePoint <= 0x7FF) {
141 out << static_cast<char>(0xC0 | (codePoint >> 6))
142 << static_cast<char>(0x80 | (codePoint & 0x3F));
143 } else if (codePoint <= 0xFFFF) {
144 out << static_cast<char>(0xE0 | (codePoint >> 12))
145 << static_cast<char>(0x80 | ((codePoint >> 6) & 0x3F))
146 << static_cast<char>(0x80 | (codePoint & 0x3F));
147 } else {
148 out << static_cast<char>(0xF0 | (codePoint >> 18))
149 << static_cast<char>(0x80 | ((codePoint >> 12) & 0x3F))
150 << static_cast<char>(0x80 | ((codePoint >> 6) & 0x3F))
151 << static_cast<char>(0x80 | (codePoint & 0x3F));
152 }
153}
154
155bool IsValidPlainScalar(const std::string& str, FlowType::value flowType,
156 bool allowOnlyAscii) {

Callers 5

WriteAliasNameFunction · 0.85
WriteSingleQuotedStringFunction · 0.85
WriteDoubleQuotedStringFunction · 0.85
WriteLiteralStringFunction · 0.85
WriteCommentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected