From 6c2f5b255c0c04e20531e2fc8ac7843df264fa5b Mon Sep 17 00:00:00 2001 From: hyzboy Date: Tue, 15 Mar 2022 18:01:38 +0800 Subject: [PATCH] added & at multi places. --- inc/hgl/filesystem/Filename.h | 1 + inc/hgl/type/StrChar.h | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/inc/hgl/filesystem/Filename.h b/inc/hgl/filesystem/Filename.h index 49c1989..acc365f 100644 --- a/inc/hgl/filesystem/Filename.h +++ b/inc/hgl/filesystem/Filename.h @@ -58,6 +58,7 @@ namespace hgl return String::newOf(fullname,p-fullname); } + /** * 组合文件名.
* 根据离散的每一级目录名称和最终名称合成完整文件名 diff --git a/inc/hgl/type/StrChar.h b/inc/hgl/type/StrChar.h index bc1b243..65af87c 100644 --- a/inc/hgl/type/StrChar.h +++ b/inc/hgl/type/StrChar.h @@ -46,7 +46,7 @@ namespace hgl * 参见https://unicode.org/Public/emoji/12.0/emoji-data.txt */ template - const bool isemoji(const T ch) + const bool isemoji(const T &ch) { if(ch==0x23)return(true); //# if(ch==0x2A)return(true); //* @@ -62,7 +62,7 @@ namespace hgl * 测试当前字符是否为小写字母 */ template - const bool islower(const T ch) + const bool islower(const T &ch) { return(ch>='a'&&ch<='z'); } @@ -71,7 +71,7 @@ namespace hgl * 测试当前字符是否为大写字母 */ template - const bool isupper(const T ch) + const bool isupper(const T &ch) { return(ch>='A'&&ch<='Z'); } @@ -80,7 +80,7 @@ namespace hgl * 测试当前字符是否为字母 */ template - const bool isalpha(const T ch) + const bool isalpha(const T &ch) { return(islower(ch)||isupper(ch)); } @@ -89,7 +89,7 @@ namespace hgl * 测试当前字符是否为10进制数字 */ template - const bool isdigit(const T ch) + const bool isdigit(const T &ch) { return(ch>='0'&&ch<='9'); } @@ -98,7 +98,7 @@ namespace hgl * 测试当前字符串是否为10进制数字以及小数点、正负符号、指数字符 */ template - const bool isfloat(const T ch) + const bool isfloat(const T &ch) { return isdigit(ch) ||ch=='-' @@ -111,7 +111,7 @@ namespace hgl } template - const bool isinteger(const T ch) + const bool isinteger(const T &ch) { return isdigit(ch) ||ch=='-' @@ -122,7 +122,7 @@ namespace hgl * 测试当前字符是否为16进制数用字符(0-9,A-F) */ template - const bool isxdigit(const T ch) + const bool isxdigit(const T &ch) { return((ch>='0'&&ch<='9') ||(ch>='a'&&ch<='f') @@ -156,7 +156,7 @@ namespace hgl * 是否为斜杠 */ template - const bool isslash(const T ch) + const bool isslash(const T &ch) { if(ch=='\\')return(true); if(ch=='/')return(true); @@ -239,7 +239,7 @@ namespace hgl * 测试当前字符是否为字母或数字 */ template - const bool isalnum(const T ch) + const bool isalnum(const T &ch) { return(isalpha(ch)||isdigit(ch)); } @@ -248,7 +248,7 @@ namespace hgl * 测试当前字符是否为代码可用字符(仅字母,数字,下划线,常用于文件名之类) */ template - const bool iscodechar(const T ch) + const bool iscodechar(const T &ch) { return(isalnum(ch)||ch=='_'); } @@ -257,7 +257,7 @@ namespace hgl * 测试当前字符是否不是代码可用字符(仅字母,数字,下划线,常用于文件名之类) */ template - const bool notcodechar(const T ch) + const bool notcodechar(const T &ch) { return(!iscodechar(ch)); } @@ -266,7 +266,7 @@ namespace hgl * 测试当前字符是否为BASE64编码字符 */ template - const bool isbase64(const T c) + const bool isbase64(const T &c) { return (c == 43 || // + (c >= 47 && c <= 57) || // /-9