MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / EncodeUnsafe

Method EncodeUnsafe

rapidjson/encodings.h:292–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290
291 template<typename OutputStream>
292 static void EncodeUnsafe(OutputStream& os, unsigned codepoint) {
293 RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 2);
294 if (codepoint <= 0xFFFF) {
295 RAPIDJSON_ASSERT(codepoint < 0xD800 || codepoint > 0xDFFF); // Code point itself cannot be surrogate pair
296 PutUnsafe(os, static_cast<typename OutputStream::Ch>(codepoint));
297 }
298 else {
299 RAPIDJSON_ASSERT(codepoint <= 0x10FFFF);
300 unsigned v = codepoint - 0x10000;
301 PutUnsafe(os, static_cast<typename OutputStream::Ch>((v >> 10) | 0xD800));
302 PutUnsafe(os, (v & 0x3FF) | 0xDC00);
303 }
304 }
305
306 template <typename InputStream>
307 static bool Decode(InputStream& is, unsigned* codepoint) {

Callers

nothing calls this directly

Calls 1

PutUnsafeFunction · 0.70

Tested by

no test coverage detected