CBlueUI
C++ 跨平台跨框架的数据可视化工具
|
宽字符串UCS2编码(内置引用计数,copy on write)。备注:wchat_t在不同平台下占用字节不一样 更多...
Public 成员函数 | |
BeStringW () | |
BeStringW (int nLength) | |
Construct a new BeStringW | |
BeStringW (const BeStringW &stringSrc) | |
BeStringW (WCHAR ch, int repeats) | |
使用repeats个符号(ch),初始化 | |
BeStringW (LPCWSTR lpsz, int nlen=-1) | |
使用宽字符串初始化 | |
BeStringW (LPCSTR lpsz, int nlen=-1, UINT codepage=CP_ACP) | |
使用多字符集字符串初始化 | |
~BeStringW () | |
const WCHAR * | c_str () const |
获得字符串数据指针 | |
const BeStringW & | operator= (const BeStringW &stringSrc) |
const BeStringW & | operator= (LPCWSTR lpsz) |
const BeStringW & | operator= (LPCSTR ansi) |
const BeStringW & | operator= (WCHAR ch) |
BeStringW | operator+ (const BeStringW &src) const |
BeStringW | operator+ (LPCWSTR pstr) const |
const BeStringW & | operator+= (const BeStringW &src) |
const BeStringW & | operator+= (LPCWSTR pstr) |
const BeStringW & | operator+= (const WCHAR ch) |
bool | operator== (const BeStringW &str) const |
bool | operator== (LPCWSTR lpsz) const |
bool | operator!= (const BeStringW &str) const |
bool | operator!= (LPCWSTR lpsz) const |
bool | operator< (const BeStringW &str) const |
bool | operator> (const BeStringW &str) const |
bool | operator<= (const BeStringW &str) const |
bool | operator>= (const BeStringW &str) const |
WCHAR & | operator[] (int nIndex) const |
void | empty () |
清空字符串 | |
size_t | length () const |
得到WCHAR字符个数。注意与符号个数区分。在UCS2编码下。稀有字符可能占用2个WCHAR长度 | |
size_t | capacity () const |
得到已经分配的内存字符长度 | |
bool | is_empty () const |
判断字符长度是否为0 | |
bool | is_number () const |
判断是否全部为整数 | |
bool | is_email () |
判断是否是邮箱 | |
bool | is_ipv4 () |
判断是否是IPV4地址 | |
bool | is_ipv6 () |
判断是否是IPV6地址 | |
bool | is_true () const |
判断是否等于true值 | |
bool | is_false () const |
判断是否等于false值 | |
bool | is_decimal_number () const |
判断是否为小数 | |
int | repeat_counts (WCHAR ch) |
字符重复的次数 | |
int | erase (int nIndex, int nCount=1) |
删除字符 | |
void | join_path (const WCHAR *wstr) |
在末尾追加字符串.同时自动处理路径分隔符(/,\). | |
int | append (LPCWSTR lpsz) |
在末尾追加字符串 | |
int | append (const WCHAR ch) |
在末尾追加字符 | |
int | append (LPCWSTR lpsz, unsigned int nlen) |
在末尾追加一定数量(nlen)的字符串 | |
int | append (const BeStringW &strSrc) |
int | append (const BeStringW &strSrc, unsigned int nlen) |
void | append_format (LPCWSTR lpszFormat,...) |
在末尾追加格式化打印的字符串. e.g: append_format(L"%d,%f", 12, 35.0); | |
void | convert2Name () |
将特殊字符转换为标识符格式(字母,数字和下划线) | |
void | make_identifier (WCHAR ch='_') |
将不满足标识符的字符用指定字符替换 | |
int | insert (int nIndex, WCHAR ch) |
在nIndex前面插入字符 | |
int | insert (int nIndex, LPCWSTR pstr, int len=-1) |
在nIndex前面插入字符串 | |
int | replace_char (WCHAR chOld, WCHAR chNew) |
替换单个字符 | |
int | replace_string (LPCWSTR lpszOld, LPCWSTR lpszNew) |
替换字符串 | |
int | toInt (bool ExprRecognition=true) const |
字符串转换成整数 | |
double | tofloat (bool ExprRecognition=true) const |
字符串转换成浮点数 | |
void | trim () |
清除首尾空格字符 | |
void | trim_left () |
清除首部空格字符 | |
void | trim_right () |
清除尾部空格字符 | |
void | remove (WCHAR chTarget) |
删除字符串中的目标字符(chTarget) | |
void | remove (LPCWSTR lpszTargets) |
删除目标字符串 | |
void | remove_float_last_zero () |
删除浮点数尾部多余的0符号 | |
void | make_upper () |
转换为大写字符串 | |
void | make_lower () |
转换为小写字符串 | |
BeStringW | mid (int nStart, int nCount) const |
截取字符串. e.g: BeStringW s0 = "hello word"; BeStringW s1 = s0.min(1,3); // s1 = "ell" | |
int | compare (LPCWSTR lpsz) const |
比较字符串.(大小写敏感,即"abc" != "Abc") | |
int | compare (const BeStringW &stringSrc) const |
int | compare_no_case (LPCWSTR lpsz) const |
比较字符串.(大小写忽略,即"abc" == "Abc") | |
int | compare_no_case (const BeStringW &stringSrc) const |
void | format (LPCWSTR lpszFormat,...) |
格式化输出 | |
int | find (WCHAR ch) const |
查找字符,并返回第一个匹配到的索引位置 | |
int | find (WCHAR ch, int nStart) const |
在指定开始位置(nStart)之后,查找字符,并返回第一个匹配到的索引位置 | |
int | find (LPCWSTR lpszSub) const |
查找字符串,,并返回第一个匹配到的索引位置 | |
int | find (LPCWSTR lpszSub, int nStart) const |
在指定开始位置(nStart)之后,查找字符串,并返回第一个匹配到的索引位置 | |
int | reverse_find (WCHAR ch) const |
从末尾开始查找字符.并返回第一个匹配到的索引位置 | |
Public 属性 | |
AtomicLock | m_lock |
宽字符串UCS2编码(内置引用计数,copy on write)。备注:wchat_t在不同平台下占用字节不一样
BeStringW::BeStringW | ( | ) |
BeStringW::BeStringW | ( | int | nLength | ) |
Construct a new BeStringW
nLength:预分配符号长度 |
BeStringW::BeStringW | ( | const BeStringW & | stringSrc | ) |
BeStringW::BeStringW | ( | WCHAR | ch, |
int | repeats | ||
) |
使用repeats个符号(ch),初始化
ch | :字符 |
repeats | :重复次数 |
BeStringW::BeStringW | ( | LPCWSTR | lpsz, |
int | nlen = -1 |
||
) |
使用宽字符串初始化
lpsz | :UTF16字符串指针 |
nlen | :长度。若nlen < -1时,表示一直到字符终止符'\0'. |
使用多字符集字符串初始化
lpsz | :多字符集字符串指针 |
nlen | :长度.若nlen < -1时,表示一直到字符终止符'\0'. |
codepage | :字符串(lpsz)的字符集.CP_ACP表示ANSI系统本地编码.CP_UTF8表示unicode字符集 |
BeStringW::~BeStringW | ( | ) |
int BeStringW::append | ( | const BeStringW & | strSrc | ) |
int BeStringW::append | ( | const BeStringW & | strSrc, |
unsigned int | nlen | ||
) |
int BeStringW::append | ( | const WCHAR | ch | ) |
在末尾追加字符
int BeStringW::append | ( | LPCWSTR | lpsz | ) |
在末尾追加字符串
int BeStringW::append | ( | LPCWSTR | lpsz, |
unsigned int | nlen | ||
) |
在末尾追加一定数量(nlen)的字符串
void BeStringW::append_format | ( | LPCWSTR | lpszFormat, |
... | |||
) |
在末尾追加格式化打印的字符串. e.g: append_format(L"%d,%f", 12, 35.0);
const WCHAR * BeStringW::c_str | ( | ) | const |
获得字符串数据指针
size_t BeStringW::capacity | ( | ) | const |
得到已经分配的内存字符长度
int BeStringW::compare | ( | const BeStringW & | stringSrc | ) | const |
int BeStringW::compare | ( | LPCWSTR | lpsz | ) | const |
比较字符串.(大小写敏感,即"abc" != "Abc")
lpsz | :比较字符 |
int BeStringW::compare_no_case | ( | const BeStringW & | stringSrc | ) | const |
int BeStringW::compare_no_case | ( | LPCWSTR | lpsz | ) | const |
比较字符串.(大小写忽略,即"abc" == "Abc")
lpsz | :比较字符 |
void BeStringW::convert2Name | ( | ) |
将特殊字符转换为标识符格式(字母,数字和下划线)
void BeStringW::empty | ( | ) |
清空字符串
int BeStringW::erase | ( | int | nIndex, |
int | nCount = 1 |
||
) |
删除字符
nIndex | :开始删除位置 |
nCount | :删除数量 |
int BeStringW::find | ( | LPCWSTR | lpszSub | ) | const |
查找字符串,,并返回第一个匹配到的索引位置
int BeStringW::find | ( | LPCWSTR | lpszSub, |
int | nStart | ||
) | const |
在指定开始位置(nStart)之后,查找字符串,并返回第一个匹配到的索引位置
int BeStringW::find | ( | WCHAR | ch | ) | const |
查找字符,并返回第一个匹配到的索引位置
int BeStringW::find | ( | WCHAR | ch, |
int | nStart | ||
) | const |
在指定开始位置(nStart)之后,查找字符,并返回第一个匹配到的索引位置
void BeStringW::format | ( | LPCWSTR | lpszFormat, |
... | |||
) |
格式化输出
int BeStringW::insert | ( | int | nIndex, |
LPCWSTR | pstr, | ||
int | len = -1 |
||
) |
在nIndex前面插入字符串
nIndex | :插入位置 |
pstr | :字符串 |
len | :字符串的长度.若nlen < -1时,表示一直到字符终止符'\0'. |
int BeStringW::insert | ( | int | nIndex, |
WCHAR | ch | ||
) |
在nIndex前面插入字符
nIndex | :插入位置 |
ch | :字符 |
bool BeStringW::is_decimal_number | ( | ) | const |
判断是否为小数
bool BeStringW::is_email | ( | ) |
判断是否是邮箱
bool BeStringW::is_empty | ( | ) | const |
判断字符长度是否为0
bool BeStringW::is_false | ( | ) | const |
判断是否等于false值
bool BeStringW::is_ipv4 | ( | ) |
判断是否是IPV4地址
bool BeStringW::is_ipv6 | ( | ) |
判断是否是IPV6地址
bool BeStringW::is_number | ( | ) | const |
判断是否全部为整数
bool BeStringW::is_true | ( | ) | const |
判断是否等于true值
void BeStringW::join_path | ( | const WCHAR * | wstr | ) |
在末尾追加字符串.同时自动处理路径分隔符(/,\).
size_t BeStringW::length | ( | ) | const |
得到WCHAR字符个数。注意与符号个数区分。在UCS2编码下。稀有字符可能占用2个WCHAR长度
void BeStringW::make_identifier | ( | WCHAR | ch = '_' | ) |
将不满足标识符的字符用指定字符替换
void BeStringW::make_lower | ( | ) |
转换为小写字符串
void BeStringW::make_upper | ( | ) |
转换为大写字符串
BeStringW BeStringW::mid | ( | int | nStart, |
int | nCount | ||
) | const |
bool BeStringW::operator!= | ( | const BeStringW & | str | ) | const |
bool BeStringW::operator!= | ( | LPCWSTR | lpsz | ) | const |
bool BeStringW::operator< | ( | const BeStringW & | str | ) | const |
bool BeStringW::operator<= | ( | const BeStringW & | str | ) | const |
bool BeStringW::operator== | ( | const BeStringW & | str | ) | const |
bool BeStringW::operator== | ( | LPCWSTR | lpsz | ) | const |
bool BeStringW::operator> | ( | const BeStringW & | str | ) | const |
bool BeStringW::operator>= | ( | const BeStringW & | str | ) | const |
WCHAR & BeStringW::operator[] | ( | int | nIndex | ) | const |
void BeStringW::remove | ( | LPCWSTR | lpszTargets | ) |
删除目标字符串
void BeStringW::remove | ( | WCHAR | chTarget | ) |
删除字符串中的目标字符(chTarget)
void BeStringW::remove_float_last_zero | ( | ) |
删除浮点数尾部多余的0符号
int BeStringW::repeat_counts | ( | WCHAR | ch | ) |
字符重复的次数
int BeStringW::reverse_find | ( | WCHAR | ch | ) | const |
从末尾开始查找字符.并返回第一个匹配到的索引位置
double BeStringW::tofloat | ( | bool | ExprRecognition = true | ) | const |
字符串转换成浮点数
int BeStringW::toInt | ( | bool | ExprRecognition = true | ) | const |
字符串转换成整数
void BeStringW::trim | ( | ) |
清除首尾空格字符
void BeStringW::trim_left | ( | ) |
清除首部空格字符
void BeStringW::trim_right | ( | ) |
清除尾部空格字符
|
mutable |