NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
icharacter< T, CharT > 模板结构体 参考

字符类型接口 更多...

#include <icharacter.hpp>

类 icharacter< T, CharT > 继承关系图:
[图例]

Public 成员函数

constexpr icharacter (CharT value) noexcept
 构造函数
constexpr operator bool () const noexcept
 转换为bool操作符
Public 成员函数 继承自 ipackage< T, CharT >
constexpr operator package_type () const noexcept
 类型转换操作符
constexpr package_type value () const noexcept
 获取数值
constexpr int64_t to_int64 () const noexcept
 转换为64位整数
constexpr size_t to_hash () const noexcept
 计算哈希值
constexpr void swap (T &other) noexcept
 交换内容
constexpr bool equal_to (const T &other) const noexcept
 相等比较操作符
constexpr bool less_than (const T &other) const noexcept
 小于比较操作符
constexpr T & operator+= (const T &other) noexcept
 加法赋值操作符
constexpr T & operator-= (const T &other) noexcept
 减法赋值操作符
constexpr T & operator*= (const T &other) noexcept
 乘法赋值操作符
constexpr T & operator/= (const T &other)
 除法赋值操作符
constexpr T & operator%= (const T &other)
 取模赋值操作符
constexpr T operator- () const noexcept
 一元负号操作符
constexpr T & operator++ () noexcept
 前置递增操作符
constexpr T & operator-- () noexcept
 前置递减操作符
constexpr T operator~ () const noexcept
 按位取反操作符
constexpr T & operator&= (const T &other) noexcept
 按位与赋值操作符
constexpr T & operator|= (const T &other) noexcept
 按位或赋值操作符
constexpr T & operator^= (const T &other) noexcept
 按位异或赋值操作符
constexpr T & operator<<= (const uint32_t shift)
 左移赋值操作符
constexpr T & operator>>= (const uint32_t shift)
 右移赋值操作符
Public 成员函数 继承自 icomparable< T >
constexpr bool operator== (const T &rhs) const noexcept(noexcept(derived().equal_to(rhs)))
 相等比较运算符
constexpr bool operator!= (const T &rhs) const noexcept(noexcept(!(derived().equal_to(rhs))))
 不等比较运算符
constexpr bool operator< (const T &rhs) const noexcept(noexcept(derived().less_than(rhs)))
 小于比较运算符
constexpr bool operator> (const T &rhs) const noexcept(noexcept(rhs.less_than(derived())))
 大于比较运算符
constexpr bool operator<= (const T &rhs) const noexcept(noexcept(!(rhs.less_than(derived()))))
 小于等于比较运算符
constexpr bool operator>= (const T &rhs) const noexcept(noexcept(!(derived().less_than(rhs))))
 大于等于比较运算符
Public 成员函数 继承自 ihashable< T >
constexpr size_t to_ihash () const noexcept(noexcept(derived().to_hash()))
 获取对象的哈希值
Public 成员函数 继承自 iarithmetic< T >
constexpr T operator+ (const T &other) const noexcept(noexcept(const_cast< T & >(derived()).operator+=(other)))
 加法运算符
constexpr T operator- (const T &other) const noexcept(noexcept(const_cast< T & >(derived()).operator-=(other)))
 减法运算符
constexpr T operator* (const T &other) const noexcept(noexcept(const_cast< T & >(derived()).operator*=(other)))
 乘法运算符
constexpr T operator/ (const T &other) const noexcept(noexcept(const_cast< T & >(derived()).operator/=(other)))
 除法运算符
constexpr T operator% (const T &other) const noexcept(noexcept(const_cast< T & >(derived()).operator%=(other)))
 取模运算符
constexpr T operator- () const noexcept(noexcept(derived().operator-()))
 一元负号运算符
constexpr T & operator+= (const T &other) noexcept(noexcept(derived().operator+=(other)))
 加法赋值运算符
constexpr T & operator-= (const T &other) noexcept(noexcept(derived().operator-=(other)))
 减法赋值运算符
constexpr T & operator*= (const T &other) noexcept(noexcept(derived().operator*=(other)))
 乘法赋值运算符
constexpr T & operator/= (const T &other)
 除法赋值运算符
constexpr T & operator%= (const T &other)
 取模赋值运算符
constexpr T & operator++ () noexcept(noexcept(derived().operator++()))
 前置自增运算符
constexpr T operator++ (int) noexcept(noexcept(derived().operator++()))
 后置自增运算符
constexpr T & operator-- () noexcept(noexcept(derived().operator--()))
 前置自减运算符
constexpr T operator-- (int) noexcept(noexcept(derived().operator--()))
 后置自减运算符
Public 成员函数 继承自 ibinary< T >
constexpr T operator& (const T &other) const noexcept(noexcept(const_cast< T & >(derived()).operator&=(other)))
 按位与运算符
constexpr T operator| (const T &other) const noexcept(noexcept(const_cast< T & >(derived()).operator|=(other)))
 按位或运算符
constexpr T operator^ (const T &other) const noexcept(noexcept(const_cast< T & >(derived()).operator^=(other)))
 按位异或运算符
constexpr T operator~ () const noexcept(noexcept(derived().operator~()))
 按位取反运算符
constexpr T operator<< (const uint32_t shift) const
 左移运算符
constexpr T operator>> (const uint32_t shift) const
 右移运算符
constexpr T & operator&= (const T &other) noexcept(noexcept(derived().operator&=(other)))
 按位与赋值运算符
constexpr T & operator|= (const T &other) noexcept(noexcept(derived().operator|=(other)))
 按位或赋值运算符
constexpr T & operator^= (const T &other) noexcept(noexcept(derived().operator^=(other)))
 按位异或赋值运算符
constexpr T & operator<<= (const uint32_t shift)
 左移赋值运算符
constexpr T & operator>>= (const uint32_t shift)
 右移赋值运算符

静态 Public 成员函数

static constexpr string to_string (const basic_string_view< CharT > &obj)
 转换为普通字符串
static constexpr wstring to_wstring (const basic_string_view< CharT > &obj)
 转换为宽字符串
static constexpr u8string to_u8string (const basic_string_view< CharT > &obj)
 转换为UTF-8字符串
static constexpr u16string to_u16string (const basic_string_view< CharT > &obj)
 转换为UTF-16字符串
static constexpr u32string to_u32string (const basic_string_view< CharT > &obj)
 转换为UTF-32字符串
静态 Public 成员函数 继承自 ipackage< T, CharT >
static constexpr size_t bytes () noexcept
 获取类型字节大小
static constexpr size_t bits () noexcept
 获取类型位大小

额外继承的成员函数

Public 类型 继承自 ipackage< T, CharT >
using package_type
 包装类型
Protected 成员函数 继承自 ipackage< T, CharT >
constexpr ~ipackage ()=default
 受保护的析构函数
Protected 属性 继承自 ipackage< T, CharT >
package_type value_
 存储的数值

详细描述

template<typename T, typename CharT>
struct icharacter< T, CharT >

字符类型接口

模板参数
T派生类型
CharT字符类型

为字符包装类型提供统一的接口,支持字符到各种字符串类型的转换。

在文件 icharacter.hpp31 行定义.

构造及析构函数说明

◆ icharacter()

template<typename T, typename CharT>
icharacter< T, CharT >::icharacter ( CharT value)
inlineconstexprnoexcept

构造函数

参数
value字符值

在文件 icharacter.hpp47 行定义.

成员函数说明

◆ operator bool()

template<typename T, typename CharT>
icharacter< T, CharT >::operator bool ( ) const
inlineexplicitnodiscardconstexprnoexcept

转换为bool操作符

返回
字符是否非空

在文件 icharacter.hpp54 行定义.

◆ to_string()

template<typename T, typename CharT>
constexpr string icharacter< T, CharT >::to_string ( const basic_string_view< CharT > & obj)
inlinestaticconstexpr

转换为普通字符串

参数
obj字符视图
返回
普通字符串

在文件 icharacter.hpp63 行定义.

◆ to_u16string()

template<typename T, typename CharT>
constexpr u16string icharacter< T, CharT >::to_u16string ( const basic_string_view< CharT > & obj)
inlinestaticconstexpr

转换为UTF-16字符串

参数
obj字符视图
返回
UTF-16字符串

在文件 icharacter.hpp86 行定义.

◆ to_u32string()

template<typename T, typename CharT>
constexpr u32string icharacter< T, CharT >::to_u32string ( const basic_string_view< CharT > & obj)
inlinestaticconstexpr

转换为UTF-32字符串

参数
obj字符视图
返回
UTF-32字符串

在文件 icharacter.hpp95 行定义.

◆ to_u8string()

template<typename T, typename CharT>
constexpr u8string icharacter< T, CharT >::to_u8string ( const basic_string_view< CharT > & obj)
inlinestaticconstexpr

转换为UTF-8字符串

参数
obj字符视图
返回
UTF-8字符串

在文件 icharacter.hpp78 行定义.

◆ to_wstring()

template<typename T, typename CharT>
constexpr wstring icharacter< T, CharT >::to_wstring ( const basic_string_view< CharT > & obj)
inlinestaticconstexpr

转换为宽字符串

参数
obj字符视图
返回
宽字符串

在文件 icharacter.hpp70 行定义.


该结构体的文档由以下文件生成: