|
YSTest
PreAlpha_b500_20140530
The YSLib Test Project
|
命名空间 | |
| CharSet | |
类 | |
| struct | ConversionState |
| 编码转换状态。 更多... | |
| class | GUCS2Mapper |
| 静态编码映射模板及 Unicode 编码特化。 更多... | |
| struct | GUCS2Mapper< CharSet::Big5 > |
| struct | GUCS2Mapper< CharSet::GBK > |
| struct | GUCS2Mapper< CharSet::SHIFT_JIS > |
| 非 Unicode 编码映射模板特化。 更多... | |
| struct | GUCS2Mapper< CharSet::UTF_16BE > |
| struct | GUCS2Mapper< CharSet::UTF_16LE > |
| struct | GUCS2Mapper< CharSet::UTF_8 > |
类型定义 | |
| using | ucs2_t = char16_t |
| UCS-2 字符类型。 更多... | |
| using | ucs4_t = char32_t |
| UCS-4 字符类型。 更多... | |
| using | ucsint_t = std::char_traits< ucs4_t >::int_type |
| UCS 整数类型。 更多... | |
枚举 | |
| enum | ConversionResult { ConversionResult::OK = 0, ConversionResult::BadState, ConversionResult::BadSource, ConversionResult::Invalid, ConversionResult::Unhandled } |
| 编码转换结果。 更多... | |
函数 | |
| ucs2_t | FetchBiCharBE (const char *c_ptr) |
| 取 c_ptr 指向的大端序双字节字符。 更多... | |
| ucs2_t | FetchBiCharLE (const char *c_ptr) |
| 取 c_ptr 指向的小端序双字节字符。 更多... | |
| YF_API size_t | FetchFixedCharWidth (Encoding) |
| 取指定固定编码的固定字符宽度。 更多... | |
| YF_API size_t | FetchMaxCharWidth (Encoding) |
| 取指定编码的最大字符宽度。 更多... | |
| YF_API size_t | FetchMaxVariantCharWidth (Encoding) |
| 取指定变长编码的最大字符宽度。 更多... | |
| template<typename _tChar > | |
| yconstfn bool | IsASCII (_tChar c) |
| 判断整数类型字符在 ASCII 字符取值范围内。 更多... | |
| template<typename _tChar > | |
| yconstfn char | ToASCII (_tChar c) |
| 任意整数类型字符转换为 ASCII 取值范围兼容的字符。 更多... | |
| template<class _tString > | |
| std::basic_string< ucs2_t > | ucsdup (const _tString &str) |
| template<typename _tIn , typename _fConv > | |
| ConversionResult | ConvertCharacter (_fConv f, ucs2_t &uc, _tIn &&i, ConversionState &&st) |
| template<typename _tIn , typename _fConv > | |
| ConversionResult | ConvertCharacter (_fConv f, _tIn &&i, ConversionState &&st) |
| template<typename _fCodemapTransform > | |
| _fCodemapTransform * | FetchMapperPtr (Encoding enc) |
| 取指定编码映射的转换函数指针。 更多... | |
| template<typename _tIn , typename _tState > | |
| bool | FillByte (_tIn &i, _tState &st) |
| 以输入迭代器指向内容填充有效输入迭代器指定的字节。 更多... | |
| ConversionResult | MBCToUC (ucs2_t &uc, std::FILE *fp, Encoding enc, ConversionState &&st) |
| ConversionResult | MBCToUC (const char *&c, Encoding enc, ConversionState &&st) |
| ConversionResult | MBCToUC (std::FILE *fp, Encoding enc, ConversionState &&st) |
| size_t | UCToMBC (char *d, const ucs2_t &s, Encoding enc) |
| YF_API std::basic_string< ucs2_t > | ucsdup (const char *, Encoding=CS_Default) |
| 复制多字节字符串为 UCS-2 字符串。 更多... | |
| YF_API std::basic_string< ucs2_t > | ucsdup (const ucs2_t *) |
| 复制 UCS-2 字符串。 更多... | |
| YF_API std::basic_string< ucs2_t > | ucsdup (const ucs4_t *) |
| 复制 UCS-4 字符串为 UCS-2 字符串。 更多... | |
| template<class _tDst > | |
| _tDst | MakeUCS2LEString (const char *s, Encoding enc=CS_Default) |
| 复制指定编码的多字节字符串为指定类型的 UCS-2 字符串。 更多... | |
| template<class _tDst > | |
| _tDst | MakeUCS2LEString (const ucs2_t *s, Encoding=CharSet::ISO_10646_UCS_2) |
| 复制指定类型的 UCS-2 字符串。 更多... | |
| template<class _tDst > | |
| _tDst | MakeUCS2LEString (const ucs4_t *s, Encoding=CharSet::ISO_10646_UCS_4) |
| 复制 UCS-4 字符串为指定类型的 UCS-2 字符串。 更多... | |
| template<Encoding , typename... _tParams> | |
| yconstfn ConversionResult | UCS2Mapper_Map (_tParams &&...) |
| 取映射函数。 更多... | |
| template<Encoding _vEnc, typename _tDst , typename _tSrc , typename _tState > | |
| yconstfn ConversionResult | UCS2Mapper_Map (_tDst &&d, _tSrc &&s, _tState &&st, decltype(&GUCS2Mapper< _vEnc >::template Map< _tDst, _tSrc, _tState >)={}) |
| template<Encoding _vEnc, typename _tDst , typename _tSrc > | |
| yconstfn byte | UCS2Mapper_InverseMap (_tDst, _tSrc) |
| template<Encoding _vEnc, typename _tDst > | |
| yconstfn byte | UCS2Mapper_InverseMap (_tDst &&d, const ucs2_t &s, decltype(&GUCS2Mapper< _vEnc >::template InverseMap< _tDst >)={}) |
| template<Encoding _vEnc, typename _tIn , typename _tState > | |
| yconstexpr ConversionResult | UCS2Mapper (ucs2_t &uc, _tIn &&i, _tState &&st) |
| template<Encoding _vEnc, typename _tIn , typename _tState > | |
| yconstexpr ConversionResult | UCS2Mapper (_tIn &&i, _tState &&st) |
| template<Encoding _vEnc> | |
| byte | UCS2Mapper (char *d, const ucs2_t &s) |
变量 | |
| yconstexpr Encoding | CS_Default = CharSet::UTF_8 |
| 默认字符编码。 更多... | |
| byte * | cp17 |
| 动态加载的编码转换表。 更多... | |
| byte * | cp113 |
| byte * | cp2026 |
| c | |
| enc | |
| std::FILE | Encoding |
| std::FILE ConversionState | fp |
| YF_API ConversionResult | MBCToUC (ucs2_t &, const char *&, Encoding, ConversionState &&={}) |
| 按指定编码和转换状态转换字符串中字符为 UCS-2 字符,返回转换的字节数。 更多... | |
| PDefH (ConversionResult, MBCToUC, ucs2_t &uc, const char *&c, Encoding enc, ConversionState &st) ImplRet(MBCToUC(uc | |
| std::FILE ConversionState && | PDefH (ConversionResult, MBCToUC, ucs2_t &uc, std::FILE *fp, Encoding enc, ConversionState &st) ImplRet(MBCToUC(uc |
| std::FILE ConversionState ConversionState && | PDefH (ConversionResult, MBCToUC, const char *&c, Encoding enc, ConversionState &st) ImplRet(MBCToUC(c |
| PDefH (ConversionResult, MBCToUC, std::FILE *fp, Encoding enc, ConversionState &st) ImplRet(MBCToUC(fp | |
| YF_API size_t | MBCSToUCS2 (ucs2_t *, const char *, Encoding=CS_Default) |
| 按指定编码转换 MBCS 字符串为 UCS-2 字符串,返回转换的串长。 更多... | |
| YF_API size_t | UCS2ToMBCS (char *, const ucs2_t *, Encoding=CS_Default) |
| 按指定编码转换 UCS-2 字符串为 MBCS 字符串,返回转换的串长。 更多... | |
| YF_API size_t | UCS4ToUCS2 (ucs2_t *, const ucs4_t *) |
| 转换 UCS-4 字符串为 UCS-2 字符串,返回转换的串长。 更多... | |
| template<class _tDst , class _tSrc > | |
| _tDst | GetMBCSOf (const _tSrc &src, Encoding enc=CS_Default) |
| 取 UCS-2 字符串转换的指定编码的多字节字符串。 更多... | |
| YF_API std::string | strdup (const ucs2_t *, Encoding=CS_Default) |
| 复制 UCS-2 字符串为多字节字符串。 更多... | |
| template<class _tString > | |
| std::string | strdup (const _tString &str) |
| using CHRLib::ucs2_t = typedef char16_t |
| using CHRLib::ucs4_t = typedef char32_t |
| using CHRLib::ucsint_t = typedef std::char_traits<ucs4_t>::int_type |
|
strong |
| ConversionResult CHRLib::ConvertCharacter | ( | _fConv | f, |
| ucs2_t & | uc, | ||
| _tIn && | i, | ||
| ConversionState && | st | ||
| ) |
在文件 Convert.hpp 第 40 行定义.
参考 YSLib::UI::f.
参考自 YSLib::Text::TextFileBuffer::GetIterator(), YSLib::Text::TextFileBuffer::GetPosition(), MBCSToUCS2() , 以及 MBCToUC().

| ConversionResult CHRLib::ConvertCharacter | ( | _fConv | f, |
| _tIn && | i, | ||
| ConversionState && | st | ||
| ) |
在文件 Convert.hpp 第 47 行定义.
参考 YSLib::UI::f.
|
inline |
|
inline |
| size_t CHRLib::FetchFixedCharWidth | ( | Encoding | cp | ) |
取指定固定编码的固定字符宽度。
在文件 chrmap.cpp 第 37 行定义.
参考 CHRLib::CharSet::csASCII, CHRLib::CharSet::csUCS4, CHRLib::CharSet::csUnicode, CHRLib::CharSet::csUTF16, CHRLib::CharSet::csUTF16BE, CHRLib::CharSet::csUTF16LE, CHRLib::CharSet::csUTF32, CHRLib::CharSet::csUTF32BE , 以及 CHRLib::CharSet::csUTF32LE.
参考自 FetchMaxCharWidth().

| _fCodemapTransform* CHRLib::FetchMapperPtr | ( | Encoding | enc | ) |
取指定编码映射的转换函数指针。
参考 CHRLib::CharSet::Big5(), CHR_MapItem, CHRLib::CharSet::GBK(), CHRLib::CharSet::SHIFT_JIS(), CHRLib::CharSet::UTF_16BE(), CHRLib::CharSet::UTF_16LE() , 以及 CHRLib::CharSet::UTF_8().
参考自 MBCSToUCS2(), MBCToUC(), UCS2ToMBCS() , 以及 UCToMBC().


| size_t CHRLib::FetchMaxCharWidth | ( | Encoding | cp | ) |
取指定编码的最大字符宽度。
在文件 chrmap.cpp 第 59 行定义.
参考 FetchFixedCharWidth(), FetchMaxVariantCharWidth() , 以及 YSLib::Drawing::r.

| size_t CHRLib::FetchMaxVariantCharWidth | ( | Encoding | cp | ) |
取指定变长编码的最大字符宽度。
在文件 chrmap.cpp 第 67 行定义.
参考 CHRLib::CharSet::csGB18030, CHRLib::CharSet::csGBK , 以及 CHRLib::CharSet::csUTF8.
参考自 FetchMaxCharWidth().

|
inline |
以输入迭代器指向内容填充有效输入迭代器指定的字节。
参考 ystdex::is_undereferenceable(), YSLib::Drawing::r, YB_UNLIKELY , 以及 yunseq.
参考自 CHRLib::GUCS2Mapper< CharSet::UTF_8 >::Map(), CHRLib::GUCS2Mapper< CharSet::GBK >::Map(), CHRLib::GUCS2Mapper< CharSet::UTF_16BE >::Map() , 以及 CHRLib::GUCS2Mapper< CharSet::UTF_16LE >::Map().


| _tDst CHRLib::GetMBCSOf | ( | const _tSrc & | src, |
| Encoding | enc = CS_Default |
||
| ) |
| yconstfn bool CHRLib::IsASCII | ( | _tChar | c | ) |
| _tDst CHRLib::MakeUCS2LEString | ( | const char * | s, |
| Encoding | enc = CS_Default |
||
| ) |
| _tDst CHRLib::MakeUCS2LEString | ( | const ucs2_t * | s, |
| Encoding | = CharSet::ISO_10646_UCS_2 |
||
| ) |
| _tDst CHRLib::MakeUCS2LEString | ( | const ucs4_t * | s, |
| Encoding | = CharSet::ISO_10646_UCS_4 |
||
| ) |
| size_t CHRLib::MBCSToUCS2 | ( | ucs2_t * | d, |
| const char * | s, | ||
| Encoding | enc = CS_Default |
||
| ) |
按指定编码转换 MBCS 字符串为 UCS-2 字符串,返回转换的串长。
在文件 chrproc.cpp 第 112 行定义.
参考 ConvertCharacter(), FetchMapperPtr(), ystdex::is_null() , 以及 yconstraint.
参考自 MakeUCS2LEString(), platform::u16getcwd_n() , 以及 ucsdup().


| ConversionResult CHRLib::MBCToUC | ( | ucs2_t & | uc, |
| std::FILE * | fp, | ||
| Encoding | enc, | ||
| ConversionState && | st | ||
| ) |
在文件 chrproc.cpp 第 60 行定义.
参考 ConvertCharacter(), FetchMapperPtr(), YSLib::Drawing::r, Unhandled , 以及 yconstraint.

| ConversionResult CHRLib::MBCToUC | ( | ucs2_t & | uc, |
| const char *& | c, | ||
| Encoding | enc, | ||
| ConversionState && | st = {} |
||
| ) |
按指定编码和转换状态转换字符串中字符为 UCS-2 字符,返回转换的字节数。
在文件 chrproc.cpp 第 52 行定义.
参考 ConvertCharacter(), FetchMapperPtr() , 以及 Unhandled.
参考自 YSLib::TextFile::ReadChar() , 以及 YSLib::TextFile::SkipChar().


| ConversionResult CHRLib::MBCToUC | ( | const char *& | c, |
| Encoding | enc, | ||
| ConversionState && | st | ||
| ) |
| ConversionResult CHRLib::MBCToUC | ( | std::FILE * | fp, |
| Encoding | enc, | ||
| ConversionState && | st | ||
| ) |
在文件 chrproc.cpp 第 83 行定义.
参考 ConvertCharacter(), FetchMapperPtr(), YSLib::Drawing::r, Unhandled , 以及 yconstraint.

|
inline |
|
inline |
|
inline |
|
inline |
| std::string CHRLib::strdup | ( | const ucs2_t * | s, |
| Encoding | enc = CS_Default |
||
| ) |
复制 UCS-2 字符串为多字节字符串。
sizeof(ucsint_t) 字节。 在文件 chrproc.cpp 第 162 行定义.
参考 ystdex::make_unique(), ystdex::ntctslen(), UCS2ToMBCS() , 以及 yconstraint.
参考自 YSLib::IO::EnsureDirectory(), platform::HDirectory::GetName(), strdup(), platform::ufopen() , 以及 platform::uopen().


| std::string CHRLib::strdup | ( | const _tString & | str | ) |
| yconstfn char CHRLib::ToASCII | ( | _tChar | c | ) |
| yconstexpr ConversionResult CHRLib::UCS2Mapper | ( | ucs2_t & | uc, |
| _tIn && | i, | ||
| _tState && | st | ||
| ) |
| yconstexpr ConversionResult CHRLib::UCS2Mapper | ( | _tIn && | i, |
| _tState && | st | ||
| ) |
| byte CHRLib::UCS2Mapper | ( | char * | d, |
| const ucs2_t & | s | ||
| ) |
参考 platform_ex::Windows::s , 以及 yconstraint.
| yconstfn byte CHRLib::UCS2Mapper_InverseMap | ( | _tDst | , |
| _tSrc | |||
| ) |
| yconstfn byte CHRLib::UCS2Mapper_InverseMap | ( | _tDst && | d, |
| const ucs2_t & | s, | ||
| decltype &<>::<> | _tDst = {} |
||
| ) |
| yconstfn ConversionResult CHRLib::UCS2Mapper_Map | ( | _tParams && | ... | ) |
| yconstfn ConversionResult CHRLib::UCS2Mapper_Map | ( | _tDst && | d, |
| _tSrc && | s, | ||
| _tState && | st, | ||
| decltype(&GUCS2Mapper< _vEnc >::template Map< _tDst, _tSrc, _tState >) | = {} |
||
| ) |
| size_t CHRLib::UCS2ToMBCS | ( | char * | d, |
| const ucs2_t * | s, | ||
| Encoding | enc = CS_Default |
||
| ) |
按指定编码转换 UCS-2 字符串为 MBCS 字符串,返回转换的串长。
在文件 chrproc.cpp 第 132 行定义.
参考 FetchMapperPtr(), ystdex::is_null() , 以及 yconstraint.
参考自 GetMBCSOf() , 以及 strdup().


| size_t CHRLib::UCS4ToUCS2 | ( | ucs2_t * | d, |
| const ucs4_t * | s | ||
| ) |
转换 UCS-4 字符串为 UCS-2 字符串,返回转换的串长。
在文件 chrproc.cpp 第 147 行定义.
参考 ystdex::is_null() , 以及 yconstraint.
参考自 MakeUCS2LEString() , 以及 ucsdup().


| std::basic_string< ucs2_t > CHRLib::ucsdup | ( | const char * | s, |
| Encoding | enc = CS_Default |
||
| ) |
复制多字节字符串为 UCS-2 字符串。
在文件 chrproc.cpp 第 174 行定义.
参考 ystdex::make_unique(), MBCSToUCS2(), ystdex::ntctslen() , 以及 yconstraint.
参考自 ucsdup().


| std::basic_string< ucs2_t > CHRLib::ucsdup | ( | const ucs2_t * | s | ) |
复制 UCS-2 字符串。
在文件 chrproc.cpp 第 184 行定义.
参考 ystdex::make_unique(), ystdex::ntctslen() , 以及 yconstraint.

| std::basic_string< ucs2_t > CHRLib::ucsdup | ( | const ucs4_t * | s | ) |
复制 UCS-4 字符串为 UCS-2 字符串。
在文件 chrproc.cpp 第 195 行定义.
参考 ystdex::make_unique(), ystdex::ntctslen(), UCS4ToUCS2() , 以及 yconstraint.

| std::basic_string<ucs2_t> CHRLib::ucsdup | ( | const _tString & | str | ) |
| size_t CHRLib::UCToMBC | ( | char * | d, |
| const ucs2_t & | s, | ||
| Encoding | enc | ||
| ) |
| CHRLib::c |
参考自 YSLib::Drawing::DrawArrow(), YSLib::UI::TextBox::DrawClippedText(), YSLib::UI::DrawTrackBackground(), ystdex::make_move_iterator_pair(), NPL::MakeEscape(), YSLib::Drawing::TextRenderer::operator()(), YSLib::File::operator>>(), YSLib::PostMessage(), YSLib::Drawing::RenderCharAlpha(), NPL::Session::Session(), YSLib::UI::ColorBox::SetColor(), ystdex::split(), ystdex::split_l(), ystdex::container_adaptor< _tSeqCon >::swap() , 以及 YSLib::UI::HexViewArea::UpdateData().
| byte * CHRLib::cp113 |
| byte * CHRLib::cp17 |
| yconstexpr Encoding CHRLib::CS_Default = CharSet::UTF_8 |
| std::FILE ConversionState ConversionState CHRLib::enc |
| const ucs2_t CHRLib::Encoding |
| std::FILE ConversionState CHRLib::fp |
参考自 ystdex::fexists() , 以及 platform::truncate().