YSTest
PreAlpha_b400_20130424
The YSLib Test Project
|
命名空间 | |
namespace | CharSet |
类 | |
struct | ConversionState |
编码转换状态。 更多... | |
class | GUCS2Mapper |
静态编码映射模板及 Unicode 编码特化。 更多... | |
struct | GUCS2Mapper< CharSet::UTF_8 > |
struct | GUCS2Mapper< CharSet::UTF_16BE > |
struct | GUCS2Mapper< CharSet::UTF_16LE > |
类型定义 | |
typedef char16_t | ucs2_t |
UCS-2 字符类型。 | |
typedef char32_t | ucs4_t |
UCS-4 字符类型。 | |
typedef std::char_traits < ucs4_t >::int_type | ucsint_t |
UCS 整数类型。 | |
枚举 | |
enum | ConversionResult |
编码转换结果。 更多... | |
函数 | |
ucs2_t | FetchBiCharBE (const char *c_ptr) |
取 c_ptr 指向的大端序双字节字符。 | |
ucs2_t | FetchBiCharLE (const char *c_ptr) |
取 c_ptr 指向的小端序双字节字符。 | |
yconstfn std::uint_fast8_t & | GetCountOf (ConversionState &st) |
yconstfn ucsint_t & | GetWideOf (ConversionState &st) |
yconstfn byte * | GetSequenceOf (ConversionState &st) |
template<typename _type > | |
yconstfn _type & | GetCountOf (_type &st) |
一般类型计数。 | |
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 字符。 | |
YF_API size_t | UCToMBC (char *, const ucs2_t &, Encoding) |
按指定编码转换 UCS-2 字符中字符为字符串表示的多字节字符,返回转换的字节数。 | |
YF_API size_t | MBCSToUCS2 (ucs2_t *, const char *, Encoding=CS_Default) |
按指定编码转换 MBCS 字符串为 UTF-16LE 字符串,返回转换的串长。 | |
YF_API size_t | UCS2ToMBCS (char *, const ucs2_t *, Encoding=CS_Default) |
按指定编码转换 UTF-16LE 字符串为 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) |
取指定编码的多字节字符串。 | |
YF_API char * | strdup (const ucs2_t *, Encoding=CS_Default) |
复制 UCS-2LE 字符串为多字节字符串。 | |
YF_API ucs2_t * | ucsdup (const char *, Encoding=CS_Default) |
复制多字节字符串为 UCS-2/UTF-16LE 字符串。 | |
YF_API ucs2_t * | ucsdup (const ucs2_t *) |
复制 UCS-2 字符串。 | |
YF_API ucs2_t * | ucsdup (const ucs4_t *) |
复制 UCS-4 字符串为 UCS-2 字符串。 | |
template<typename _tIn , typename _fConv > | |
ConversionResult | ConvertCharacter (_fConv f, ucs2_t &uc, _tIn &&it, ConversionState &&st) |
template<typename _tIn , typename _fConv > | |
ConversionResult | ConvertCharacter (_fConv f, _tIn &&it, ConversionState &&st) |
template<typename _tIn , typename _tState > | |
bool | FillByte (_tIn &i, _tState &st) |
以输入迭代器指向内容填充有效输入迭代器指定的字节。 | |
YF_API ConversionResult | MBCToUC (ucs2_t &, const char *&, Encoding, ConversionState &&={}) |
按指定编码和转换状态转换字符串中字符为 UCS-2 字符,返回转换的字节数。 | |
ConversionResult | MBCToUC (ucs2_t &uc, const char *&c, Encoding enc, ConversionState &st) |
YF_API ConversionResult | MBCToUC (ucs2_t &, std::FILE *, Encoding, ConversionState &&={}) |
按指定编码和转换状态转换字符流中字符为 UCS-2 字符,返回转换的字节数。 | |
ConversionResult | MBCToUC (ucs2_t &uc, std::FILE *fp, Encoding enc, ConversionState &st) |
YF_API ConversionResult | MBCToUC (const char *&, Encoding, ConversionState &&={}) |
按指定编码和转换状态返回转换字符为 UCS-2 字符的字节数。 | |
ConversionResult | MBCToUC (const char *&c, Encoding enc, ConversionState &st) |
YF_API ConversionResult | MBCToUC (std::FILE *, Encoding, ConversionState &&={}) |
ConversionResult | MBCToUC (std::FILE *fp, Encoding enc, ConversionState &st) |
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 |
默认字符编码。 | |
typedef char16_t CHRLib::ucs2_t |
typedef char32_t CHRLib::ucs4_t |
typedef std::char_traits<ucs4_t>::int_type CHRLib::ucsint_t |
ConversionResult CHRLib::ConvertCharacter | ( | _fConv | f, |
ucs2_t & | uc, | ||
_tIn && | it, | ||
ConversionState && | st | ||
) |
在文件 Convert.hpp 第 38 行定义.
参考自 YSLib::Text::TextFileBuffer::GetIterator(),YSLib::Text::TextFileBuffer::GetPosition(),MBCSToUCS2(),MBCToUC() , 以及 YSLib::Text::TextFileBuffer::operator[]().
ConversionResult CHRLib::ConvertCharacter | ( | _fConv | f, |
_tIn && | it, | ||
ConversionState && | st | ||
) |
在文件 Convert.hpp 第 45 行定义.
|
inline |
|
inline |
YF_API size_t CHRLib::FetchFixedCharWidth | ( | Encoding | ) |
取指定固定编码的固定字符宽度。
在文件 chrmap.cpp 第 35 行定义.
参考 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().
YF_API size_t CHRLib::FetchMaxCharWidth | ( | Encoding | ) |
取指定编码的最大字符宽度。
在文件 chrmap.cpp 第 57 行定义.
参考 FetchFixedCharWidth() , 以及 FetchMaxVariantCharWidth().
YF_API size_t CHRLib::FetchMaxVariantCharWidth | ( | Encoding | ) |
取指定变长编码的最大字符宽度。
在文件 chrmap.cpp 第 65 行定义.
参考 CHRLib::CharSet::csGB18030,CHRLib::CharSet::csGBK , 以及 CHRLib::CharSet::csUTF8.
参考自 FetchMaxCharWidth().
|
inline |
以输入迭代器指向内容填充有效输入迭代器指定的字节。
参考 GetCountOf(),GetSequenceOf(),ystdex::is_undereferenceable(),YB_UNLIKELY , 以及 yunseq().
参考自 CHRLib::GUCS2Mapper< CharSet::UTF_8 >::Map(),GUCS2Mapper< CharSet::GBK >::Map(),CHRLib::GUCS2Mapper< CharSet::UTF_16BE >::Map() , 以及 CHRLib::GUCS2Mapper< CharSet::UTF_16LE >::Map().
yconstfn std::uint_fast8_t& CHRLib::GetCountOf | ( | ConversionState & | st | ) |
参考 CHRLib::ConversionState::Count.
参考自 FillByte(),YSLib::Text::TextFileBuffer::GetIterator(),YSLib::Text::TextFileBuffer::GetPosition(),CHRLib::GUCS2Mapper< CharSet::UTF_8 >::Map(),GUCS2Mapper< CharSet::GBK >::Map(),CHRLib::GUCS2Mapper< CharSet::UTF_16BE >::Map(),CHRLib::GUCS2Mapper< CharSet::UTF_16LE >::Map() , 以及 YSLib::Text::TextFileBuffer::operator[]().
yconstfn _type& CHRLib::GetCountOf | ( | _type & | st | ) |
_tDst CHRLib::GetMBCSOf | ( | const _tSrc & | src, |
Encoding | enc = CS_Default |
||
) |
yconstfn byte* CHRLib::GetSequenceOf | ( | ConversionState & | st | ) |
yconstfn bool CHRLib::IsASCII | ( | _tChar | c | ) |
YF_API size_t CHRLib::MBCSToUCS2 | ( | ucs2_t * | , |
const char * | , | ||
Encoding | = CS_Default |
||
) |
按指定编码转换 MBCS 字符串为 UTF-16LE 字符串,返回转换的串长。
YF_API ConversionResult CHRLib::MBCToUC | ( | ucs2_t & | , |
const char *& | , | ||
Encoding | , | ||
ConversionState && | = {} |
||
) |
按指定编码和转换状态转换字符串中字符为 UCS-2 字符,返回转换的字节数。
参考自 MBCToUC(),YSLib::TextFile::ReadChar() , 以及 YSLib::TextFile::SkipChar().
|
inline |
YF_API ConversionResult CHRLib::MBCToUC | ( | ucs2_t & | , |
std::FILE * | , | ||
Encoding | , | ||
ConversionState && | = {} |
||
) |
按指定编码和转换状态转换字符流中字符为 UCS-2 字符,返回转换的字节数。
|
inline |
YF_API ConversionResult CHRLib::MBCToUC | ( | const char *& | , |
Encoding | , | ||
ConversionState && | = {} |
||
) |
按指定编码和转换状态返回转换字符为 UCS-2 字符的字节数。
|
inline |
YF_API ConversionResult CHRLib::MBCToUC | ( | std::FILE * | , |
Encoding | , | ||
ConversionState && | = {} |
||
) |
|
inline |
YF_API char* CHRLib::strdup | ( | const ucs2_t * | , |
Encoding | = CS_Default |
||
) |
复制 UCS-2LE 字符串为多字节字符串。
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 | ||
) |
参考 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 >) | = {} |
||
) |
YF_API size_t CHRLib::UCS2ToMBCS | ( | char * | , |
const ucs2_t * | , | ||
Encoding | = CS_Default |
||
) |
按指定编码转换 UTF-16LE 字符串为 MBCS 字符串,返回转换的串长。
YF_API size_t CHRLib::UCS4ToUCS2 | ( | ucs2_t * | , |
const ucs4_t * | |||
) |
转换 UCS-4 字符串为 UCS-2 字符串,返回转换的串长。
复制多字节字符串为 UCS-2/UTF-16LE 字符串。
在文件 chrproc.cpp 第 172 行定义.
参考 MBCSToUCS2(),YB_LIKELY , 以及 yconstraint.
复制 UCS-4 字符串为 UCS-2 字符串。
YF_API size_t CHRLib::UCToMBC | ( | char * | , |
const ucs2_t & | , | ||
Encoding | |||
) |
按指定编码转换 UCS-2 字符中字符为字符串表示的多字节字符,返回转换的字节数。
yconstexpr Encoding CHRLib::CS_Default = CharSet::UTF_8 |