CBlueUI
C++ 跨平台跨框架的数据可视化工具
|
枚举 | |
enum | ChinaPinyinOption { PY_MASK_FULLNAME = 1 , PY_MASK_FIRST_CAPS = 1 << 1 , PY_MASK_ALL_CAPS = 1 << 2 , PY_MASK_INSERT_SPACE = 1 << 3 } |
函数 | |
UI_EXP bool | IsASCIITextA (const char *str, int len=-1) |
判断字符串是否为ASCII | |
UI_EXP bool | IsASCIITextW (LPCWSTR str, int len=-1) |
判断字符串是否为ASCII | |
UI_EXP bool | IsASCIIText (LPCTSTR str, int len=-1) |
判断字符串是否为ASCII | |
UI_EXP bool | IsUTF8 (const char *str) |
判断字符是否是UTF8编码方式 | |
UI_EXP bool | IsGBK (const char *str) |
判断字符是否是GBK编码方式 | |
UI_EXP bool | ToMulitLinesA (std::vector< std::string > &lines, const char *str, unsigned int len) |
根据换行符,将字符串转换为多行 | |
UI_EXP bool | ToNumsA (std::vector< double > &nums, const char *str) |
根据空格符号,将字符串转换为数值数组 | |
UI_EXP int | ConverterMultiByteToWideChar (UINT CodePage, const char *lpMultiByteStr, int cbMultiByte, WCHAR *lpWideCharStr, int cchWideChar) |
UI_EXP int | ConverterWideCharToMultiByte (UINT CodePage, const WCHAR *lpWideCharStr, int cchWideChar, char *lpMultiByteStr, int cbMultiByte) |
UI_EXP int | WideCharToUtf8 (char *buf, int buf_size, unsigned int code_point) |
convert unicode to utf8 | |
UI_EXP int | Utf8CharToWide (unsigned int *out_char, const char *in_text, const char *in_text_end) |
convert utf8 to unicode | |
UI_EXP int | ToMultiByte (const char *src, int len, BasicStringBufferA &outstr, UINT cp_from, UINT cp_to) |
格式转换 | |
UI_EXP int | UnicodeToMultiByte (const WCHAR *wc, int len, BasicStringBufferA &outstr, UINT cp_to=CP_UTF8) |
unicode字符转换为多字符集(GBK,ISO) | |
UI_EXP int | MultiByteToUnicode (const char *src, int len, BasicStringBufferW &outstr, UINT cp_from) |
多字符集(GBK,ISO) 转换为unicode字符 | |
UI_EXP void | UnicodeToChinaPinyin (LPCSTR utf8Str, UINT options, std::string &result) |
转换为拼音 | |
UI_EXP BOOL | IsLittleEnding () |
是否是小端模式 | |
UI_EXP BOOL | IsStackPtr (void *p) |
UI_EXP BOOL | IsDecimalFormateA (const char *str, int len=-1) |
是否满足小数输入格式 | |
UI_EXP BOOL | IsIntegerA (const char *str, int len=-1) |
UI_EXP BOOL | IsIdentfierA (const char *str, int len=-1) |
UI_EXP BOOL | IsDecimalFormateW (const WCHAR *str, int len=-1) |
是否满足小数输入格式 | |
UI_EXP BOOL | IsIntegerW (const WCHAR *str, int len=-1) |
UI_EXP BOOL | IsIdentfierW (const WCHAR *str, int len=-1) |
UI_EXP BOOL | IsDecimalFormate (const TCHAR *str, int len=-1) |
是否满足小数输入格式 | |
UI_EXP BOOL | IsInteger (const TCHAR *str, int len=-1) |
UI_EXP BOOL | IsIdentfier (const TCHAR *str, int len=-1) |
UI_EXP int | GetIntegerCharCount (int v) |
获得整数需要的十进制位数位数 | |
UI_EXP int | GetCharsCount (LPCTSTR text, int count) |
返回字符个数 | |
UI_EXP LPCSTR | FindNextBracketA (LPCSTR text, char start_bracket, char end_bracket, int levels=0) |
返回括号分组的结束位置 | |
UI_EXP LPCWSTR | FindNextBracketW (LPCWSTR text, WCHAR start_bracket, WCHAR end_bracket, int levels=0) |
返回括号分组的结束位置 | |
UI_EXP std::vector< std::string > | SplitWithCharA (const char *str, const char *pattern, int count=0, BOOL skip_bracket=FALSE) |
字符串分词拆分。单个字符匹配 | |
UI_EXP std::vector< std::w16string > | SplitWithCharW (const WCHAR *str, const WCHAR *pattern, int count=0, BOOL skip_bracket=FALSE) |
UI_EXP std::vector< std::string > | SplitWithTextA (std::string str, std::string pattern, int count=0) |
字符串分词拆分。字符串匹配 | |
UI_EXP std::vector< std::w16string > | SplitWithTextW (std::w16string str, std::w16string pattern, int count=0) |
UI_EXP void | SplitAttribute (const TCHAR *text, std::vector< std::pair< std::tstring, std::tstring > > &result, TCHAR SplitCharacter=(TCHAR)';') |
UI_EXP bool | CalculatorValue (double &value, const char *str, int len=-1) |
计算器解析器 | |
UI_EXP void | ConvertBaseTextToBytes (BasicStringBufferA &out_buf, int &len, LPCTSTR str, int base) |
将基于base进制的字符串转换为字节流 | |
UI_EXP void | GetPrevDirPath (LPCTSTR fullname, BasicStringBuffer &prev_path) |
获取上级目录 | |
UI_EXP void | GetPrevDirPathA (LPCSTR fullname, BasicStringBufferA &prev_path) |
UI_EXP void | GetPrevDirPathW (LPCWSTR fullname, BasicStringBufferW &prev_path) |
UI_EXP void | GetFileSuffix (LPCTSTR fullname, BasicStringBuffer &suffix, BOOL isComplete=TRUE) |
获取文件后缀 | |
UI_EXP void | GetFileSuffixA (LPCSTR fullname, BasicStringBufferA &suffix, BOOL isComplete=TRUE) |
UI_EXP void | GetFileSuffixW (LPCWSTR fullname, BasicStringBufferW &suffix, BOOL isComplete=TRUE) |
UI_EXP void | GetFileBaseName (LPCTSTR fullname, BasicStringBuffer &basename, BOOL isComplete=TRUE) |
获取不包含后缀的文件名 | |
UI_EXP void | GetFileBaseNameA (LPCSTR fullname, BasicStringBufferA &basename, BOOL isComplete=TRUE) |
UI_EXP void | GetFileBaseNameW (LPCWSTR fullname, BasicStringBufferW &basename, BOOL isComplete=TRUE) |
UI_EXP void | GetFileName (LPCTSTR fullname, BasicStringBuffer &filename) |
获取文件名称 | |
UI_EXP void | GetFilePath (LPCTSTR fullname, BasicStringBuffer &filepath) |
获取路径,不包含文件 | |
UI_EXP void | ParseToAlign (UINT &align, LPCTSTR value) |
解析对齐方式 | |
UI_EXP void | IntToString (int num, int base, BasicStringBuffer &target) |
整数转换为文本。(2,8,10,16 进制) | |
UI_EXP bool | ParserNumericalValueA (const char *str, const char *end, char **next_ptr, double &value, int &is_percent_value) |
解析数值。(可识别模式 156.e-2,0b1101,0o154,0x1245,#5421) | |
UI_EXP bool | ParserNumericalValueW (const WCHAR *str, const WCHAR *end, WCHAR **next_ptr, double &value, int &is_percent_value) |
UI_EXP bool | ParserNumericalValue (const TCHAR *str, const TCHAR *end, TCHAR **next_ptr, double &value, int &is_percent_value) |
UI_EXP int | ParserToIntA (const char *str, int base=10) |
解析进制整数。(2,8,10,16 进制) | |
UI_EXP int | ParserToIntW (const WCHAR *str, int base=10) |
UI_EXP int | ParserToInt (const TCHAR *str, int base=10) |
UI_EXP double | ParserToDoubleA (const char *str, bool ExprRecognition) |
UI_EXP double | ParserToDoubleW (const WCHAR *str, bool ExprRecognition) |
UI_EXP double | ParserToDouble (const TCHAR *str, bool ExprRecognition) |
UI_EXP PenType | ParserPenType (const TCHAR *str) |
解析画笔类型 solid, dot, dash, dash-dot, dash-dot-dot | |
UI_EXP void | SkipSpaceOrChar (const char **str, char c) |
跳过指定字符 | |
UI_EXP bool | ParseCsvDoubles (const char *str, double *value, int num_values, char **next) |
解析以逗号分隔的数值 | |
UI_EXP bool UtilsString::CalculatorValue | ( | double & | value, |
const char * | str, | ||
int | len = -1 |
||
) |
计算器解析器
UI_EXP void UtilsString::ConvertBaseTextToBytes | ( | BasicStringBufferA & | out_buf, |
int & | len, | ||
LPCTSTR | str, | ||
int | base | ||
) |
将基于base进制的字符串转换为字节流
UI_EXP int UtilsString::ConverterMultiByteToWideChar | ( | UINT | CodePage, |
const char * | lpMultiByteStr, | ||
int | cbMultiByte, | ||
WCHAR * | lpWideCharStr, | ||
int | cchWideChar | ||
) |
UI_EXP int UtilsString::ConverterWideCharToMultiByte | ( | UINT | CodePage, |
const WCHAR * | lpWideCharStr, | ||
int | cchWideChar, | ||
char * | lpMultiByteStr, | ||
int | cbMultiByte | ||
) |
UI_EXP LPCSTR UtilsString::FindNextBracketA | ( | LPCSTR | text, |
char | start_bracket, | ||
char | end_bracket, | ||
int | levels = 0 |
||
) |
返回括号分组的结束位置
UI_EXP LPCWSTR UtilsString::FindNextBracketW | ( | LPCWSTR | text, |
WCHAR | start_bracket, | ||
WCHAR | end_bracket, | ||
int | levels = 0 |
||
) |
返回括号分组的结束位置
UI_EXP void UtilsString::GetFileBaseName | ( | LPCTSTR | fullname, |
BasicStringBuffer & | basename, | ||
BOOL | isComplete = TRUE |
||
) |
获取不包含后缀的文件名
isComplete | 完整后缀 |
UI_EXP void UtilsString::GetFileBaseNameA | ( | LPCSTR | fullname, |
BasicStringBufferA & | basename, | ||
BOOL | isComplete = TRUE |
||
) |
UI_EXP void UtilsString::GetFileBaseNameW | ( | LPCWSTR | fullname, |
BasicStringBufferW & | basename, | ||
BOOL | isComplete = TRUE |
||
) |
UI_EXP void UtilsString::GetFileName | ( | LPCTSTR | fullname, |
BasicStringBuffer & | filename | ||
) |
获取文件名称
UI_EXP void UtilsString::GetFilePath | ( | LPCTSTR | fullname, |
BasicStringBuffer & | filepath | ||
) |
获取路径,不包含文件
UI_EXP void UtilsString::GetFileSuffix | ( | LPCTSTR | fullname, |
BasicStringBuffer & | suffix, | ||
BOOL | isComplete = TRUE |
||
) |
获取文件后缀
isComplete | 完整后缀比如xxxx.tar.gz(.tar.gz称之为完整后缀) |
UI_EXP void UtilsString::GetFileSuffixA | ( | LPCSTR | fullname, |
BasicStringBufferA & | suffix, | ||
BOOL | isComplete = TRUE |
||
) |
UI_EXP void UtilsString::GetFileSuffixW | ( | LPCWSTR | fullname, |
BasicStringBufferW & | suffix, | ||
BOOL | isComplete = TRUE |
||
) |
UI_EXP int UtilsString::GetIntegerCharCount | ( | int | v | ) |
获得整数需要的十进制位数位数
UI_EXP void UtilsString::GetPrevDirPath | ( | LPCTSTR | fullname, |
BasicStringBuffer & | prev_path | ||
) |
获取上级目录
UI_EXP void UtilsString::GetPrevDirPathA | ( | LPCSTR | fullname, |
BasicStringBufferA & | prev_path | ||
) |
UI_EXP void UtilsString::GetPrevDirPathW | ( | LPCWSTR | fullname, |
BasicStringBufferW & | prev_path | ||
) |
UI_EXP void UtilsString::IntToString | ( | int | num, |
int | base, | ||
BasicStringBuffer & | target | ||
) |
整数转换为文本。(2,8,10,16 进制)
num | 待转换的数值 | |
base | 目标字符串的进制 | |
[ | out] | outstr :输出到目标字符串 |
UI_EXP bool UtilsString::IsASCIITextA | ( | const char * | str, |
int | len = -1 |
||
) |
判断字符串是否为ASCII
UI_EXP bool UtilsString::IsGBK | ( | const char * | str | ) |
判断字符是否是GBK编码方式
UI_EXP bool UtilsString::IsUTF8 | ( | const char * | str | ) |
判断字符是否是UTF8编码方式
UI_EXP int UtilsString::MultiByteToUnicode | ( | const char * | src, |
int | len, | ||
BasicStringBufferW & | outstr, | ||
UINT | cp_from | ||
) |
多字符集(GBK,ISO) 转换为unicode字符
src | 多字符集串 |
len | 转换长度 |
outstr | 转换后的unicode字符集 |
cp_from | 多字符集编码 GBK, ISO |
UI_EXP bool UtilsString::ParseCsvDoubles | ( | const char * | str, |
double * | value, | ||
int | num_values, | ||
char ** | next | ||
) |
解析以逗号分隔的数值
str | 输入 |
value | 输出缓冲数组 |
num_values | 缓冲大小 |
next | 下次扫描位置 |
UI_EXP bool UtilsString::ParserNumericalValue | ( | const TCHAR * | str, |
const TCHAR * | end, | ||
TCHAR ** | next_ptr, | ||
double & | value, | ||
int & | is_percent_value | ||
) |
UI_EXP bool UtilsString::ParserNumericalValueA | ( | const char * | str, |
const char * | end, | ||
char ** | next_ptr, | ||
double & | value, | ||
int & | is_percent_value | ||
) |
解析数值。(可识别模式 156.e-2,0b1101,0o154,0x1245,#5421)
str | 扫描字符串开始位置 | |
end | 扫描字符串结束位置 | |
[ | out] | value :输出数值 |
[ | out] | is_percent_value :输出数值是否为百分比模式 |
[ | out] | next_ptr :输出下一次解析的指针位置 |
UI_EXP bool UtilsString::ParserNumericalValueW | ( | const WCHAR * | str, |
const WCHAR * | end, | ||
WCHAR ** | next_ptr, | ||
double & | value, | ||
int & | is_percent_value | ||
) |
解析画笔类型 solid, dot, dash, dash-dot, dash-dot-dot
UI_EXP double UtilsString::ParserToDoubleA | ( | const char * | str, |
bool | ExprRecognition | ||
) |
UI_EXP int UtilsString::ParserToIntA | ( | const char * | str, |
int | base = 10 |
||
) |
解析进制整数。(2,8,10,16 进制)
UI_EXP void UtilsString::SkipSpaceOrChar | ( | const char ** | str, |
char | c | ||
) |
跳过指定字符
UI_EXP void UtilsString::SplitAttribute | ( | const TCHAR * | text, |
std::vector< std::pair< std::tstring, std::tstring > > & | result, | ||
TCHAR | SplitCharacter = (TCHAR)';' |
||
) |
UI_EXP std::vector< std::string > UtilsString::SplitWithCharA | ( | const char * | str, |
const char * | pattern, | ||
int | count = 0 , |
||
BOOL | skip_bracket = FALSE |
||
) |
字符串分词拆分。单个字符匹配
str | 输入字符串 |
pattern | 分割字符集合 |
count | 匹配次数 |
skip_bracket | TRUE:忽略被{'(', ')'}, {'[', ']'}, {'{', '}'}, {'<', '>'}包裹的匹配字符 |
UI_EXP std::vector< std::w16string > UtilsString::SplitWithCharW | ( | const WCHAR * | str, |
const WCHAR * | pattern, | ||
int | count = 0 , |
||
BOOL | skip_bracket = FALSE |
||
) |
UI_EXP std::vector< std::string > UtilsString::SplitWithTextA | ( | std::string | str, |
std::string | pattern, | ||
int | count = 0 |
||
) |
字符串分词拆分。字符串匹配
str | 输入字符串 |
pattern | 分割字符串 |
count | 匹配次数 |
skip_bracket | TRUE:忽略被{'(', ')'}, {'[', ']'}, {'{', '}'}, {'<', '>'}包裹的匹配字符串 |
UI_EXP std::vector< std::w16string > UtilsString::SplitWithTextW | ( | std::w16string | str, |
std::w16string | pattern, | ||
int | count = 0 |
||
) |
UI_EXP bool UtilsString::ToMulitLinesA | ( | std::vector< std::string > & | lines, |
const char * | str, | ||
unsigned int | len | ||
) |
根据换行符,将字符串转换为多行
UI_EXP int UtilsString::ToMultiByte | ( | const char * | src, |
int | len, | ||
BasicStringBufferA & | outstr, | ||
UINT | cp_from, | ||
UINT | cp_to | ||
) |
格式转换
UI_EXP bool UtilsString::ToNumsA | ( | std::vector< double > & | nums, |
const char * | str | ||
) |
根据空格符号,将字符串转换为数值数组
UI_EXP void UtilsString::UnicodeToChinaPinyin | ( | LPCSTR | utf8Str, |
UINT | options, | ||
std::string & | result | ||
) |
转换为拼音
utf8Str | utf8格式字符 | |
options | :ChinaPinyinOption | |
[ | out] | result: |
UI_EXP int UtilsString::UnicodeToMultiByte | ( | const WCHAR * | wc, |
int | len, | ||
BasicStringBufferA & | outstr, | ||
UINT | cp_to = CP_UTF8 |
||
) |
unicode字符转换为多字符集(GBK,ISO)
wc | unicode宽字符 |
len | 转换长度 |
outstr | 转换后的多字符集 |
cp_to | 多字符集编码 GBK, ISO |
UI_EXP int UtilsString::Utf8CharToWide | ( | unsigned int * | out_char, |
const char * | in_text, | ||
const char * | in_text_end | ||
) |
convert utf8 to unicode
out_char | 输出unicode字符 |
in_text | 起始字符 |
in_text_end | 结束字符 |
UI_EXP int UtilsString::WideCharToUtf8 | ( | char * | buf, |
int | buf_size, | ||
unsigned int | code_point | ||
) |
convert unicode to utf8
buf | 输出utf8格式字符缓冲 |
buf_size | |
code_point | 宽字符编码 |