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

Function QueueUnicodeCodepoint

lib/yamlcpp/src/stream.cpp:161–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161inline void QueueUnicodeCodepoint(std::deque<char>& q, unsigned long ch) {
162 // We are not allowed to queue the Stream::eof() codepoint, so
163 // replace it with CP_REPLACEMENT_CHARACTER
164 if (static_cast<unsigned long>(Stream::eof()) == ch) {
165 ch = CP_REPLACEMENT_CHARACTER;
166 }
167
168 if (ch < 0x80) {
169 q.push_back(Utf8Adjust(ch, 0, 0));
170 } else if (ch < 0x800) {
171 q.push_back(Utf8Adjust(ch, 2, 6));
172 q.push_back(Utf8Adjust(ch, 1, 0));
173 } else if (ch < 0x10000) {
174 q.push_back(Utf8Adjust(ch, 3, 12));
175 q.push_back(Utf8Adjust(ch, 1, 6));
176 q.push_back(Utf8Adjust(ch, 1, 0));
177 } else {
178 q.push_back(Utf8Adjust(ch, 4, 18));
179 q.push_back(Utf8Adjust(ch, 1, 12));
180 q.push_back(Utf8Adjust(ch, 1, 6));
181 q.push_back(Utf8Adjust(ch, 1, 0));
182 }
183}
184
185Stream::Stream(std::istream& input)
186 : m_input(input),

Callers 2

StreamInUtf16Method · 0.85
StreamInUtf32Method · 0.85

Calls 2

Utf8AdjustFunction · 0.85
push_backMethod · 0.45

Tested by

no test coverage detected