YSTest: MappingEx.cpp 源文件

YSTest PreAlpha_b700_20160611 The YSLib Test Project

- 首页
- 相关页面
- 模块
- 命名空间
- 类
- 文件

- 文件列表
- 文件成员

MappingEx.cpp
浏览该文件的文档.
1 /*
2 © 2012-2015 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 #include "CHRLib/YModules.h"
29 #include YFM_CHRLib_MappingEx
30
31 namespace CHRLib
32 {
33
34 using namespace CharSet;
35
36 namespace
37 {
38
40 template<byte*& _vCPMapPtr, size_t _vMax>
41 char16_t
42 dbcs_lkp(byte seq0, byte seq1)
43 {
44 const auto idx(size_t(seq0 << 8U | seq1));
45
46 return YB_LIKELY(idx < 0xFF7E)
47 ? reinterpret_cast<const char16_t*>(_vCPMapPtr + 0x0100)[idx] : 0;
48 }
49
50 } // unnamed namespacce;
51
52 #if !CHRLib_NoDynamicMapping
53
54 #if 0
55 byte* cp17;
56 #endif
57 byte* cp113;
58 #if 0
59 byte* cp2026;
60 #endif
61
62 #endif
63
64 char16_t(*cp113_lkp)(byte, byte) = dbcs_lkp<CHRLib::cp113, 0xFF7E>;
65
66 } // namespace CHRLib;
67
CHRLib::cp113_lkp
char16_t(* cp113_lkp)(byte, byte)
查找编码转换序列的实现。
Definition: MappingEx.cpp:64
CHRLib::char16_t
char16_t((*c_ptr<< CHAR_BIT)|c_ptr[1])) inline PDefH(char16_t
取 c_ptr 指向的小端序双字节字符。
CHRLib::cp17
byte * cp17
动态加载的编码转换表。
YModules.h
CHRLib::cp2026
byte * cp2026
CHRLib
Definition: CharacterDefinition.h:38
ystdex::byte
unsigned char byte
字节类型。
Definition: ydef.h:808
YB_LIKELY
#define YB_LIKELY(_expr)
Definition: ydef.h:437
CHRLib::cp113
byte * cp113
Definition: MappingEx.cpp:57