Lines Matching refs:codepoint
102 static void Encode(OutputStream& os, unsigned codepoint) { in Encode()
103 if (codepoint <= 0x7F) in Encode()
104 os.Put(static_cast<Ch>(codepoint & 0xFF)); in Encode()
105 else if (codepoint <= 0x7FF) { in Encode()
106 os.Put(static_cast<Ch>(0xC0 | ((codepoint >> 6) & 0xFF))); in Encode()
107 os.Put(static_cast<Ch>(0x80 | ((codepoint & 0x3F)))); in Encode()
109 else if (codepoint <= 0xFFFF) { in Encode()
110 os.Put(static_cast<Ch>(0xE0 | ((codepoint >> 12) & 0xFF))); in Encode()
111 os.Put(static_cast<Ch>(0x80 | ((codepoint >> 6) & 0x3F))); in Encode()
112 os.Put(static_cast<Ch>(0x80 | (codepoint & 0x3F))); in Encode()
115 RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); in Encode()
116 os.Put(static_cast<Ch>(0xF0 | ((codepoint >> 18) & 0xFF))); in Encode()
117 os.Put(static_cast<Ch>(0x80 | ((codepoint >> 12) & 0x3F))); in Encode()
118 os.Put(static_cast<Ch>(0x80 | ((codepoint >> 6) & 0x3F))); in Encode()
119 os.Put(static_cast<Ch>(0x80 | (codepoint & 0x3F))); in Encode()
124 static void EncodeUnsafe(OutputStream& os, unsigned codepoint) { in EncodeUnsafe()
125 if (codepoint <= 0x7F) in EncodeUnsafe()
126 PutUnsafe(os, static_cast<Ch>(codepoint & 0xFF)); in EncodeUnsafe()
127 else if (codepoint <= 0x7FF) { in EncodeUnsafe()
128 PutUnsafe(os, static_cast<Ch>(0xC0 | ((codepoint >> 6) & 0xFF))); in EncodeUnsafe()
129 PutUnsafe(os, static_cast<Ch>(0x80 | ((codepoint & 0x3F)))); in EncodeUnsafe()
131 else if (codepoint <= 0xFFFF) { in EncodeUnsafe()
132 PutUnsafe(os, static_cast<Ch>(0xE0 | ((codepoint >> 12) & 0xFF))); in EncodeUnsafe()
133 PutUnsafe(os, static_cast<Ch>(0x80 | ((codepoint >> 6) & 0x3F))); in EncodeUnsafe()
134 PutUnsafe(os, static_cast<Ch>(0x80 | (codepoint & 0x3F))); in EncodeUnsafe()
137 RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); in EncodeUnsafe()
138 PutUnsafe(os, static_cast<Ch>(0xF0 | ((codepoint >> 18) & 0xFF))); in EncodeUnsafe()
139 PutUnsafe(os, static_cast<Ch>(0x80 | ((codepoint >> 12) & 0x3F))); in EncodeUnsafe()
140 PutUnsafe(os, static_cast<Ch>(0x80 | ((codepoint >> 6) & 0x3F))); in EncodeUnsafe()
141 PutUnsafe(os, static_cast<Ch>(0x80 | (codepoint & 0x3F))); in EncodeUnsafe()
146 static bool Decode(InputStream& is, unsigned* codepoint) { in Decode()
147 #define RAPIDJSON_COPY() c = is.Take(); *codepoint = (*codepoint << 6) | (static_cast<unsigned char… in Decode()
152 *codepoint = static_cast<unsigned char>(c); in Decode()
158 *codepoint = 0; in Decode()
160 *codepoint = (0xFFu >> type) & static_cast<unsigned char>(c); in Decode()
276 static void Encode(OutputStream& os, unsigned codepoint) { in Encode()
278 if (codepoint <= 0xFFFF) { in Encode()
279 …RAPIDJSON_ASSERT(codepoint < 0xD800 || codepoint > 0xDFFF); // Code point itself cannot be surroga… in Encode()
280 os.Put(static_cast<typename OutputStream::Ch>(codepoint)); in Encode()
283 RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); in Encode()
284 unsigned v = codepoint - 0x10000; in Encode()
292 static void EncodeUnsafe(OutputStream& os, unsigned codepoint) { in EncodeUnsafe()
294 if (codepoint <= 0xFFFF) { in EncodeUnsafe()
295 …RAPIDJSON_ASSERT(codepoint < 0xD800 || codepoint > 0xDFFF); // Code point itself cannot be surroga… in EncodeUnsafe()
296 PutUnsafe(os, static_cast<typename OutputStream::Ch>(codepoint)); in EncodeUnsafe()
299 RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); in EncodeUnsafe()
300 unsigned v = codepoint - 0x10000; in EncodeUnsafe()
307 static bool Decode(InputStream& is, unsigned* codepoint) { in Decode()
311 *codepoint = static_cast<unsigned>(c); in Decode()
315 *codepoint = (static_cast<unsigned>(c) & 0x3FF) << 10; in Decode()
317 *codepoint |= (static_cast<unsigned>(c) & 0x3FF); in Decode()
318 *codepoint += 0x10000; in Decode()
425 static void Encode(OutputStream& os, unsigned codepoint) { in Encode()
427 RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); in Encode()
428 os.Put(codepoint); in Encode()
432 static void EncodeUnsafe(OutputStream& os, unsigned codepoint) { in EncodeUnsafe()
434 RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); in EncodeUnsafe()
435 PutUnsafe(os, codepoint); in EncodeUnsafe()
439 static bool Decode(InputStream& is, unsigned* codepoint) { in Decode()
442 *codepoint = c; in Decode()
548 static void Encode(OutputStream& os, unsigned codepoint) { in Encode()
549 RAPIDJSON_ASSERT(codepoint <= 0x7F); in Encode()
550 os.Put(static_cast<Ch>(codepoint & 0xFF)); in Encode()
554 static void EncodeUnsafe(OutputStream& os, unsigned codepoint) { in EncodeUnsafe()
555 RAPIDJSON_ASSERT(codepoint <= 0x7F); in EncodeUnsafe()
556 PutUnsafe(os, static_cast<Ch>(codepoint & 0xFF)); in EncodeUnsafe()
560 static bool Decode(InputStream& is, unsigned* codepoint) { in Decode()
562 *codepoint = c; in Decode()
623 static RAPIDJSON_FORCEINLINE void Encode(OutputStream& os, unsigned codepoint) { in Encode()
626 (*f[os.GetType()])(os, codepoint); in Encode()
630 static RAPIDJSON_FORCEINLINE void EncodeUnsafe(OutputStream& os, unsigned codepoint) { in EncodeUnsafe()
633 (*f[os.GetType()])(os, codepoint); in EncodeUnsafe()
637 static RAPIDJSON_FORCEINLINE bool Decode(InputStream& is, unsigned* codepoint) { in Decode()
640 return (*f[is.GetType()])(is, codepoint); in Decode()
662 unsigned codepoint; in Transcode() local
663 if (!SourceEncoding::Decode(is, &codepoint)) in Transcode()
665 TargetEncoding::Encode(os, codepoint); in Transcode()
671 unsigned codepoint; in TranscodeUnsafe() local
672 if (!SourceEncoding::Decode(is, &codepoint)) in TranscodeUnsafe()
674 TargetEncoding::EncodeUnsafe(os, codepoint); in TranscodeUnsafe()