added isfilenamechar/notfilenamechar two functions in StrChar.h

This commit is contained in:
2024-03-07 23:03:34 +08:00
parent 9eb928dc3a
commit f2519a16be

View File

@@ -263,6 +263,24 @@ namespace hgl
return(!iscodechar(ch)); return(!iscodechar(ch));
} }
/**
* 测试当前字符是否为文件名可用字符(不含路径分隔符)
*/
template<typename T>
const bool isfilenamechar(const T &ch)
{
return(ch=='.'||iscodechar(ch));
}
/**
* 测试当前字符是否不是文件名可用字符
*/
template<typename T>
const bool notfilenamechar(const T &ch)
{
return(!isfilenamechar(ch));
}
/** /**
* 测试当前字符是否为BASE64编码字符 * 测试当前字符是否为BASE64编码字符
*/ */