YSTest: StaticMapping.hpp 源文件

YSTest PreAlpha_b900_20201012 The YSLib Test Project

StaticMapping.hpp
浏览该文件的文档.
1 /*
2 © 2009-2017, 2019 FrankHB.
3
4 This file is part of the YSLib project, and may only be used,
5 modified, and distributed under the terms of the YSLib project
6 license, LICENSE.TXT. By continuing to use, modify, or distribute
7 this file you indicate that you have read the license and
8 understand and accept it fully.
9 */
10
28 #ifndef INC_CHRLib_StaticMapping_hpp_
29 #define INC_CHRLib_StaticMapping_hpp_ 1
30
31 #include "YModules.h"
32 #include YFM_CHRLib_CharacterMapping // for ystdex::remove_cvref_t, byte,
33 // std::is_convertible, std::is_integral, ystdex::bool_, ystdex::or_,
34 // ystdex::is_undereferenceable, ystdex::remove_reference_t, octet,
35 // ystdex::pseudo_output, YB_VerifyIterator;
36 #include <ystdex/cast.hpp> // for ystdex::not_widen_cast;
37
38 namespace CHRLib
39 {
40
42
43
47 template<typename _tIn>
48 inline bool
49 CheckIterator(_tIn& i) ynothrow
50 {
51 using value_t = ystdex::remove_cvref_t<decltype(*i)>;
52 static_assert(ystdex::or_<std::is_convertible<value_t, byte>,
53 ystdex::bool_<std::is_integral<value_t>::value
54 && sizeof(value_t) == 1>>(), "Invalid mapping source type found.");
55 using ystdex::is_undereferenceable;
56
57 return !is_undereferenceable(i);
58 }
59
65 template<typename _tIn>
66 inline bool
67 FillByte(_tIn& i, byte& b) ynoexcept(noexcept(byte(*i)) && noexcept(++i))
68 {
69 if(CheckIterator(i))
70 {
71 const auto r = byte(*i);
72
73 yunseq(++i, b = r);
74 return true;
75 }
76 return {};
77 }
78 template<typename _tIn, typename _tState>
79 inline bool
80 FillByte(_tIn& i, _tState& st) ynoexcept(noexcept(byte(*i)) && noexcept(++i)
81 && noexcept(GetSequenceOf(st)[GetIndexOf(st)++] = byte()))
82 {
83 if(CheckIterator(i))
84 {
85 static_assert(!std::is_volatile<ystdex::remove_reference_t<_tState>>(),
86 "Volatile state is not supported.");
87 const auto r = byte(*i);
88
89 yunseq(++i, GetSequenceOf(st)[GetIndexOf(st)++] = r);
90 return true;
91 }
92 return {};
93 }
94 template<typename _tIn>
95 inline bool
96 FillByte(GuardPair<_tIn>& pr, byte& b) ynoexcept(noexcept(pr.first.get()
97 != pr.second) && noexcept(FillByte(pr.first.get(), b)))
98 {
99 return pr.first.get() != pr.second ? FillByte(pr.first.get(), b) : false;
100 }
101 template<typename _tIn, typename _tState>
102 inline bool
103 FillByte(GuardPair<_tIn>& pr, _tState& st) ynoexcept(noexcept(pr.first.get()
104 != pr.second) && noexcept(FillByte(pr.first.get(), st)))
105 {
106 return pr.first.get() != pr.second ? FillByte(pr.first.get(), st) : false;
107 }
109
110
111
113
114 yconstfn PDefH(bool, IsSurrogateHead, octet x) ynothrow
116 ImplRet(x >= 0xD8 && x < 0xE0)
117
118 yconstfn PDefH(bool, IsValidSurrogateHead, octet x) ynothrow
120 ImplRet(x >= 0xD8 && x < 0xDE)
121
123 yconstfn PDefH(bool, IsValidSurrogateTail, octet x) ynothrow
124 ImplRet(x >= 0xDC && x < 0xE0)
125
126
128 struct UCSMapperBase
129 {
131
132 static void
133 Assign(ystdex::pseudo_output, char32_t) ynothrow
134 {}
135 template<typename _tObj>
136 static void
137 Assign(_tObj& uc, char32_t c) ynothrow
138 {
139 ynoexcept_assert("Invalid type found", uc = _tObj(c));
140
141 uc = _tObj(c);
142 }
144
151 template<typename _tOut>
152 static void
153 EncodeChar(_tOut d, char32_t c) ynothrowv
154 {
155 using ystdex::is_undereferenceable;
156 ynoexcept_assert("Invalid type found.", !is_undereferenceable(d));
157
158 YB_VerifyIterator(d);
159 *d = ystdex::not_widen_cast<ystdex::remove_reference_t<decltype(*d)>>(
160 c);
161 }
162 };
163
164
184 template<Encoding>
185 class GUCSMapper
186 {};
187
192 template<>
193 struct GUCSMapper<CharSet::UTF_8> : UCSMapperBase
194 {
195 using UCSMapperBase::Assign;
197 using UCSMapperBase::EncodeChar;
198
199 private:
200 template<typename _tObj, typename _tSeq>
201 static void
202 Assign1(_tObj& uc, const _tSeq& seq) ynothrow
203 {
204 ynoexcept_assert("Invalid type found", Assign(uc, char32_t()));
205
206 Assign(uc, (char32_t(seq[0] & 0x1CU) >> 2U << 8U)
207 | (char32_t(seq[0] & 0x03U) << 6) | (char32_t(seq[1]) & 0x3FU));
208 }
209
210 template<typename _tObj, typename _tSeq>
211 static void
212 Assign2(_tObj& uc, const _tSeq& seq) ynothrow
213 {
214 ynoexcept_assert("Invalid type found", Assign(uc, char32_t()));
215
216 Assign(uc, (((char32_t(seq[0]) & 0x0FU) << 4U
217 | char32_t(seq[1] & 0x3CU) >> 2U) << 8U)
218 | (char32_t(seq[1] & 0x3U) << 6U) | char32_t(seq[2] & 0x3FU));
219 }
220
221 YB_ATTR_nodiscard YB_STATELESS static yconstfn bool
222 CheckInvalid(octet x, octet y = 0x80) ynothrow
223 {
224 return IsInvalid(x) || ((x & 0xC0) != y);
225 }
226
227 public:
232 YB_ATTR_nodiscard YB_STATELESS static yconstfn bool
233 IsInvalid(octet x) ynothrow
234 {
235 return x == 0xC0 || x == 0xC1 || x > 0xF4;
236 }
237
242 template<typename _tObj, typename _tIn, typename _tState>
243 YB_ATTR_nodiscard static ConversionResult
244 Decode(_tObj&& uc, _tIn&& i, _tState&& st)
245 ynoexcept(noexcept(GetSequenceOf(st)) && noexcept(GetIndexOf(st))
246 && noexcept(!FillByte(i, st)))
247 {
248 const auto seq(GetSequenceOf(st));
249
250 switch(GetIndexOf(st))
251 {
252 case 0:
253 if(YB_UNLIKELY(!FillByte(i, st)))
254 return ConversionResult::BadSource;
255 if((seq[0] & 0x80) == 0)
256 {
257 Assign(uc, seq[0]);
258 break;
259 }
260 if(YB_UNLIKELY(CheckInvalid(seq[0], 0xC0)))
261 return ConversionResult::Invalid;
262 YB_ATTR_fallthrough;
263 case 1:
264 if(YB_UNLIKELY(!FillByte(i, st)))
265 return ConversionResult::BadSource;
266 if(YB_UNLIKELY(CheckInvalid(seq[1])))
267 return ConversionResult::Invalid;
268 if(((seq[0] ^ 0xC0) & 0xE0) == 0)
269 {
270 Assign1(uc, seq);
271 break;
272 }
273 YB_ATTR_fallthrough;
274 case 2:
275 if(YB_UNLIKELY(!FillByte(i, st)))
276 return ConversionResult::BadSource;
277 if(YB_UNLIKELY(CheckInvalid(seq[2])))
278 return ConversionResult::Invalid;
279 if(((seq[0] ^ 0xE0) & 0xF0) == 0)
280 {
281 Assign2(uc, seq);
282 break;
283 }
284 YB_ATTR_fallthrough;
285 case 3:
286 if(YB_UNLIKELY(!FillByte(i, st)))
287 return ConversionResult::BadSource;
288 if(YB_UNLIKELY(CheckInvalid(seq[3])))
289 return ConversionResult::Invalid;
290 if(YB_LIKELY(((seq[0] ^ 0xF0) & 0xF8) == 0))
291 {
292 Assign2(uc, seq);
293 break;
294 }
295 return ConversionResult::Unhandled;
296 default:
297 return ConversionResult::BadState;
298 }
299 return ConversionResult::OK;
300 }
307 template<typename _tObj, typename _tIn>
308 YB_ATTR_nodiscard static ConversionResult
309 Decode(_tObj&& uc, _tIn&& i, ConversionState& st)
310 ynoexcept_spec(!FillByte(i, st))
311 {
312 byte b;
313
314 if(YB_UNLIKELY(!FillByte(i, b)))
315 return ConversionResult::BadSource;
316 if((b & byte(0x80U)) == byte(0))
317 {
318 if(st.Index == 0)
319 {
320 uc = octet(b);
321 return ConversionResult::OK;
322 }
323 return ConversionResult::Invalid;
324 }
325
326 // XXX: See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90966.
327 #if YB_IMPL_GNUCPP && YB_IMPL_GNUCPP >= 90000
328 using state_t = unsigned;
329 #else
330 using state_t = std::uint_fast8_t;
331 #endif
332 static yconstexpr const state_t t_data_1[]{
333 8, 8, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
334 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
335 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3,
336 11, 6, 6, 6, 5, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8
337 };
338 static yconstexpr const state_t t_data_2[]{1, 2, 4, 4};
339 auto& code(st.Value.UCS4);
340 #define CHRLib_Impl_UTF8_Decode_Fill \
341 if(YB_UNLIKELY(!FillByte(i, b))) \
342 return ConversionResult::BadSource; \
343 code = (code << 6U) | char32_t(b & byte(0x3FU))
344 #define CHRLib_Impl_UTF8_Decode_Tail \
345 CHRLib_Impl_UTF8_Decode_Fill; \
346 trans(0x70U)
347 #define CHRLib_Impl_UTF8_Decode_FillTransTail(_mask) \
348 CHRLib_Impl_UTF8_Decode_Fill; \
349 trans(_mask); \
350 CHRLib_Impl_UTF8_Decode_Tail;
351 bool res(true);
352 auto trans([&](unsigned mask) ynothrow{
353 res &= (b & byte(0xC0U)) == byte(0x80U)
354 && (t_data_2[size_t(b) >> 4U & 0x3U] & mask) != 0;
355 });
356 auto& type(st.Index);
357
358 if(type == 0)
359 {
360 if((b & byte(0xC0U)) != byte(0))
361 {
362 type = t_data_1[size_t(b) & 0x3FU];
363 code = char32_t((byte(0xFFU) >> type) & b);
364 }
365 else
366 return ConversionResult::Invalid;
367 }
368 switch(type)
369 {
370 case 6:
371 CHRLib_Impl_UTF8_Decode_Fill;
372 YB_ATTR_fallthrough;
373 case 3:
374 CHRLib_Impl_UTF8_Decode_Fill;
375 YB_ATTR_fallthrough;
376 case 2:
377 CHRLib_Impl_UTF8_Decode_Fill;
378 break;
379 case 4:
380 CHRLib_Impl_UTF8_Decode_FillTransTail(3U);
381 break;
382 case 10:
383 CHRLib_Impl_UTF8_Decode_FillTransTail(4U);
384 break;
385 case 5:
386 CHRLib_Impl_UTF8_Decode_FillTransTail(1U);
387 CHRLib_Impl_UTF8_Decode_Tail;
388 break;
389 case 11:
390 CHRLib_Impl_UTF8_Decode_FillTransTail(6U);
391 CHRLib_Impl_UTF8_Decode_Tail;
392 break;
393 case 8:
394 return ConversionResult::Invalid;
395 default:
396 return ConversionResult::BadState;
397 }
398 Assign(uc, code);
399 return res ? ConversionResult::OK : ConversionResult::Invalid;
400 #undef CHRLib_Impl_UTF8_Decode_FillTransTail
401 #undef CHRLib_Impl_UTF8_Decode_Tail
402 #undef CHRLib_Impl_UTF8_Decode_Fill
403 }
404 template<typename _tObj, typename _tIn>
405 YB_ATTR_nodiscard static ConversionResult
406 Decode(_tObj&& uc, _tIn&& i, ConversionState&& st)
407 ynoexcept_spec(Decode(uc, yforward(i), st))
408 {
409 return Decode(uc, yforward(i), st);
410 }
412
414 template<typename _tOut>
415 YB_ATTR_nodiscard static size_t
416 Encode(_tOut d, char32_t c) ynothrow
417 {
418 using ystdex::is_undereferenceable;
419 size_t l(0);
420
421 YB_VerifyIterator(d);
422 if(c < 0x80U)
423 {
424 EncodeChar(d, c);
425 return 1;
426 }
427 if(c < 0x800U)
428 l = 2;
429 else
430 {
431 EncodeChar(d, octet(0xE0U | c >> 12U));
432 ++d;
433 l = 3;
434 }
435 EncodeChar(d, octet(0x80U | (c >> 6U & 0x3FU)));
436 ++d;
437 EncodeChar(d, octet(0x80U | (c & 0x3FU)));
438 return l;
439 }
440 };
441
443 template<>
444 struct GUCSMapper<CharSet::UTF_16BE> : UCSMapperBase
445 {
446 using UCSMapperBase::Assign;
447
452 template<typename _tObj, typename _tIn, typename _tState>
453 YB_ATTR_nodiscard static ConversionResult
454 Decode(_tObj&& uc, _tIn&& i, _tState&& st)
455 ynoexcept(noexcept(GetSequenceOf(st))
456 && noexcept(GetIndexOf(st)) && noexcept(!FillByte(i, st)))
457 {
458 const auto seq(GetSequenceOf(st));
459
460 switch(GetIndexOf(st))
461 {
462 case 0:
463 if(YB_UNLIKELY(!FillByte(i, st)))
464 return ConversionResult::BadSource;
465 YB_ATTR_fallthrough;
466 case 1:
467 if(YB_UNLIKELY(!FillByte(i, st)))
468 return ConversionResult::BadSource;
469 if(YB_UNLIKELY(CHRLib::IsSurrogateHead(octet(seq[0]))))
470 {
471 if(YB_UNLIKELY(!CHRLib::IsValidSurrogateHead(octet(seq[0]))))
472 return ConversionResult::Invalid;
473 }
474 else
475 {
476 Assign(uc, char32_t(seq[0]) << 8U | char32_t(seq[1]));
477 break;
478 }
479 YB_ATTR_fallthrough;
480 case 2:
481 if(YB_UNLIKELY(!FillByte(i, st)))
482 return ConversionResult::BadSource;
483 YB_ATTR_fallthrough;
484 case 3:
485 if(YB_UNLIKELY(!FillByte(i, st)))
486 return ConversionResult::BadSource;
487 if(YB_UNLIKELY(!CHRLib::IsValidSurrogateTail(octet(seq[2]))))
488 return ConversionResult::Invalid;
489 Assign(uc, char32_t(seq[0] & byte(0x03U)) << 18U
490 | char32_t(seq[1]) << 10U
491 | char32_t(seq[2] & byte(0x03U)) << 8U | char32_t(seq[3]));
492 break;
493 default:
494 return ConversionResult::BadState;
495 }
496 return ConversionResult::OK;
497 }
498 };
499
501 template<>
502 struct GUCSMapper<CharSet::UTF_16LE> : UCSMapperBase
503 {
504 using UCSMapperBase::Assign;
505
510 template<typename _tObj, typename _tIn, typename _tState>
511 YB_ATTR_nodiscard static ConversionResult
512 Decode(_tObj&& uc, _tIn&& i, _tState&& st)
513 ynoexcept(noexcept(GetSequenceOf(st))
514 && noexcept(GetIndexOf(st)) && noexcept(!FillByte(i, st)))
515 {
516 const auto seq(GetSequenceOf(st));
517
518 switch(GetIndexOf(st))
519 {
520 case 0:
521 if(YB_UNLIKELY(!FillByte(i, st)))
522 return ConversionResult::BadSource;
523 YB_ATTR_fallthrough;
524 case 1:
525 if(YB_UNLIKELY(!FillByte(i, st)))
526 return ConversionResult::BadSource;
527 if(YB_UNLIKELY(CHRLib::IsSurrogateHead(octet(seq[1]))))
528 {
529 if(YB_UNLIKELY(!CHRLib::IsValidSurrogateHead(octet(seq[1]))))
530 return ConversionResult::Invalid;
531 }
532 else
533 {
534 Assign(uc, char32_t(seq[0]) | char32_t(seq[1]) << 8U);
535 break;
536 }
537 YB_ATTR_fallthrough;
538 case 2:
539 if(YB_UNLIKELY(!FillByte(i, st)))
540 return ConversionResult::BadSource;
541 YB_ATTR_fallthrough;
542 case 3:
543 if(YB_UNLIKELY(!FillByte(i, st)))
544 return ConversionResult::BadSource;
545 if(YB_UNLIKELY(!CHRLib::IsValidSurrogateTail(octet(seq[3]))))
546 return ConversionResult::Invalid;
547 Assign(uc, char32_t(seq[0] << 10U)
548 | char32_t(seq[1] & byte(0x03U)) << 18U
549 | char32_t(seq[2]) | char32_t(seq[3] & byte(0x03U)) << 8U);
550 break;
551 default:
552 return ConversionResult::BadState;
553 }
554 return ConversionResult::OK;
555 }
556 };
557
559 template<>
560 struct GUCSMapper<CharSet::UTF_32BE> : UCSMapperBase
561 {
562 using UCSMapperBase::Assign;
563
568 template<typename _tObj, typename _tIn, typename _tState>
569 YB_ATTR_nodiscard static ConversionResult
570 Decode(_tObj&& uc, _tIn&& i, _tState&& st)
571 ynoexcept(noexcept(GetSequenceOf(st))
572 && noexcept(GetIndexOf(st)) && noexcept(!FillByte(i, st)))
573 {
574 const auto seq(GetSequenceOf(st));
575
576 switch(GetIndexOf(st))
577 {
578 case 0:
579 if(YB_UNLIKELY(!FillByte(i, st)))
580 return ConversionResult::BadSource;
581 YB_ATTR_fallthrough;
582 case 1:
583 if(YB_UNLIKELY(!FillByte(i, st)))
584 return ConversionResult::BadSource;
585 YB_ATTR_fallthrough;
586 case 2:
587 if(YB_UNLIKELY(!FillByte(i, st)))
588 return ConversionResult::BadSource;
589 YB_ATTR_fallthrough;
590 case 3:
591 if(YB_UNLIKELY(!FillByte(i, st)))
592 return ConversionResult::BadSource;
593 Assign(uc, char32_t(seq[0]) << 24U | char32_t(seq[1]) << 16U
594 | char32_t(seq[2]) << 8U | char32_t(seq[3]));
595 break;
596 default:
597 return ConversionResult::BadState;
598 }
599 return ConversionResult::OK;
600 }
601 };
602
604 template<>
605 struct GUCSMapper<CharSet::UTF_32LE> : UCSMapperBase
606 {
607 using UCSMapperBase::Assign;
608
613 template<typename _tObj, typename _tIn, typename _tState>
614 YB_ATTR_nodiscard static ConversionResult
615 Decode(_tObj&& uc, _tIn&& i, _tState&& st)
616 ynoexcept(noexcept(GetSequenceOf(st))
617 && noexcept(GetIndexOf(st)) && noexcept(!FillByte(i, st)))
618 {
619 const auto seq(GetSequenceOf(st));
620
621 switch(GetIndexOf(st))
622 {
623 case 0:
624 if(YB_UNLIKELY(!FillByte(i, st)))
625 return ConversionResult::BadSource;
626 YB_ATTR_fallthrough;
627 case 1:
628 if(YB_UNLIKELY(!FillByte(i, st)))
629 return ConversionResult::BadSource;
630 YB_ATTR_fallthrough;
631 case 2:
632 if(YB_UNLIKELY(!FillByte(i, st)))
633 return ConversionResult::BadSource;
634 YB_ATTR_fallthrough;
635 case 3:
636 if(YB_UNLIKELY(!FillByte(i, st)))
637 return ConversionResult::BadSource;
638 Assign(uc, char32_t(seq[2]) | char32_t(seq[3]) << 8U
639 | char32_t(seq[0]) << 16U | char32_t(seq[1]) << 24U);
640 break;
641 default:
642 return ConversionResult::BadState;
643 }
644 return ConversionResult::OK;
645 }
646 };
648
649
650 } // namespace CHRLib;
651
652 #endif
653
cast.hpp
C++ 转换模板。
YB_ATTR_nodiscard
#define YB_ATTR_nodiscard
标记返回值不被忽略的属性。
Definition: ydef.h:715
x
const EncapsulationBase & x
Definition: NPLA1Forms.cpp:1536
CHRLib::ConversionState
编码转换状态。
Definition: CharacterMapping.h:109
CHRLib::c
c
Definition: CharacterProcessing.h:84
yconstexpr
#define yconstexpr
指定编译时常量表达式。
Definition: ydef.h:1072
CHRLib::size_t
return size_t(d - p)
CHRLib::PDefH
YB_ATTR_nodiscard YB_PURE PDefH(char16_t, FetchBiCharBE, const char *c_ptr) ImplRet(yconstraint(c_ptr)
取 c_ptr 指向的大端序双字节字符。
ynoexcept_assert
#define ynoexcept_assert(_msg,...)
表达式 noexcept 静态断言。
Definition: ydef.h:1152
YSLib::Drawing::r
The boundary is out of the const Graphics const Rect const Point const Point Color c const Rect const Rect & r
Definition: YDraw.h:174
CHRLib::CharSet::UTF_8
yconstexpr const Encoding UTF_8(csUTF8)
CHRLib::ImplRet
YB_ATTR_nodiscard YB_PURE const char *c_ptr ImplRet(yconstraint(c_ptr), char16_t((c_ptr[1]<< CHAR_BIT)| *c_ptr)) enum class ConversionResult
编码转换结果。
Definition: CharacterMapping.h:86
CHRLib
Definition: CharacterDefinition.h:39
CHRLib::d
_tDst * d
Definition: CharacterProcessing.h:142
ynoexcept_spec
#define ynoexcept_spec(...)
表达式 noexcept 异常规范。
Definition: ydef.h:1181
YB_ATTR_fallthrough
#define YB_ATTR_fallthrough
用于 switch 语句的 fallthrough 属性。
Definition: ydef.h:655
CHRLib::CheckIterator
bool CheckIterator(_tIn &i) ynothrow
检查解码迭代器。
Definition: StaticMapping.hpp:49
CHRLib::CharSet::UTF_32LE
yconstexpr const Encoding UTF_32LE(csUTF32LE)
platform_ex::Windows::Invalid
@ Invalid
Definition: Win32/include/YCLib/MinGW32.h:485
platform_ex::Windows::unsigned
YF_API unsigned
Definition: NLS.h:52
ystdex::bool_
integral_constant< bool, _vInt > bool_
Definition: integral_constant.hpp:93
ystdex::not_widen_cast
_tDst not_widen_cast(_tSrc v)
可能缩小数值范围或数值范围最大和最小值保持不变的转换。
Definition: cast.hpp:179
CHRLib::CharSet::UTF_16BE
yconstexpr const Encoding UTF_16BE(csUTF16BE)
ystdex::or_
逻辑或。
Definition: integral_constant.hpp:172
yforward
#define yforward(_expr)
根据参数类型使用 std::forward 转发对应参数。
Definition: ydef.h:1508
YB_VerifyIterator
#define YB_VerifyIterator(_expr)
验证表达式求值的迭代器的有效性。
Definition: deref_op.hpp:67
CHRLib::IsValidSurrogateHead
yconstfn IsValidSurrogateHead
Definition: StaticMapping.hpp:118
YB_STATELESS
#define YB_STATELESS
指示函数或函数模板实例为无状态函数。
Definition: ydef.h:941
CHRLib_Impl_UTF8_Decode_FillTransTail
#define CHRLib_Impl_UTF8_Decode_FillTransTail(_mask)
Definition: StaticMapping.hpp:345
ystdex::pseudo_output
伪输出对象。
Definition: invoke.hpp:67
YSLib::i
return i
Definition: YCoreUtilities.h:177
CHRLib_Impl_UTF8_Decode_Fill
#define CHRLib_Impl_UTF8_Decode_Fill
Definition: StaticMapping.hpp:338
CHRLib::GUCSMapper
静态编码操作模板及 Unicode 编码特化。
Definition: StaticMapping.hpp:185
yunseq
#define yunseq
无序列依赖表达式组求值。
Definition: ydef.h:1535
CHRLib::FillByte
bool FillByte(_tIn &i, byte &b) ynoexcept(noexcept(byte(*i)) &&noexcept(++i))
以输入迭代器指向内容填充有效输入迭代器指定的字节。
Definition: StaticMapping.hpp:67
YSLib::UI::y
SPos SPos y
Definition: YWidget.cpp:44
YB_LIKELY
#define YB_LIKELY(_expr)
Definition: ydef.h:827
YModules.h
YSLib 用户界面模块配置文件。
ystdex::is_undereferenceable
bool is_undereferenceable(const _tIter &)
Definition: deref_op.hpp:46
CHRLib::CharSet::UTF_32BE
yconstexpr const Encoding UTF_32BE(csUTF32BE)
ynothrowv
#define ynothrowv
YSLib 无异常抛出保证验证：有条件地使用无异常抛出规范。
Definition: ydef.h:1219
CHRLib::GUCSMapper< CharSet::UTF_8 >::state_t
std::uint_fast8_t state_t
Definition: StaticMapping.hpp:328
ystdex::octet
void octet
Definition: ydef.h:1294
CHRLib_Impl_UTF8_Decode_Tail
#define CHRLib_Impl_UTF8_Decode_Tail
Definition: StaticMapping.hpp:342
ystdex::cpp2014::remove_reference_t
typename remove_reference< _type >::type remove_reference_t
Definition: meta.hpp:155
YB_UNLIKELY
#define YB_UNLIKELY(_expr)
分支预测提示。
Definition: ydef.h:828
ystdex::byte
unsigned char byte
字节类型。
Definition: ydef.h:1283
CHRLib::IsValidSurrogateTail
yconstfn octet x ynothrow IsValidSurrogateTail
Definition: StaticMapping.hpp:122
CHRLib::GetSequenceOf
YB_ATTR_nodiscard YB_PURE yconstfn ConversionState &st GetSequenceOf
Definition: CharacterMapping.h:143
ynothrow
#define ynothrow
YSLib 无异常抛出保证：若支持 noexcept 关键字， 指定特定的 noexcept 异常规范。
Definition: ydef.h:1199
YSLib::Drawing::char32_t
YB_ATTR_nodiscard YB_PURE tr TextRegion &tr char32_t
Definition: TextLayout.h:93
ynoexcept
#define ynoexcept(...)
YSLib 无异常抛出保证：指定特定的异常规范。
Definition: ydef.h:1151
CHRLib::CharSet::UTF_16LE
yconstexpr const Encoding UTF_16LE(csUTF16LE)
ystdex::remove_cvref_t
_t< remove_cvref< _type > > remove_cvref_t
Definition: meta.hpp:236
CHRLib::GuardPair
std::pair< ystdex::lref< _tIn >, const _tIn > GuardPair
Definition: CharacterMapping.h:190
yconstfn
#define yconstfn
指定编译时常量函数。
Definition: ydef.h:1073
platform::l
return l
Definition: YCLib/FileSystem.h:402