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