修正少量bug,改进注释

This commit is contained in:
2025-07-25 01:30:34 +08:00
parent 847f448ce2
commit 0a29b964e3
3 changed files with 13 additions and 13 deletions

View File

@@ -43,7 +43,7 @@ namespace hgl
RingBuffer(int); ///<本类构造函数 RingBuffer(int); ///<本类构造函数
virtual ~RingBuffer(); ///<本类析构函数 virtual ~RingBuffer(); ///<本类析构函数
const int GetBufferSize()const{return buffer_size;} ///<取缓冲区长度 const int GetBufferSize()const{return buffer_size;} ///<取缓冲区长度
void Clear(); ///<清除整个缓冲区 void Clear(); ///<清除整个缓冲区
void SafeClear(); ///<安全清除整个缓冲区 void SafeClear(); ///<安全清除整个缓冲区

View File

@@ -725,7 +725,7 @@ namespace hgl
return bs.Length(); return bs.Length();
} }
if(bs.Length<=0) if(bs.Length()<=0)
return 1; return 1;
return data->CaseComp(bs.data->c_str(),num); return data->CaseComp(bs.data->c_str(),num);
@@ -891,14 +891,14 @@ namespace hgl
public: public:
SelfClass TrimLeft ()const{return StrConv(trimleft);} ///<删除字符串前端的空格、换行等不可字符 SelfClass TrimLeft ()const{return StrConv(trimleft);} ///<删除字符串前端的空格、换行等不可字符
SelfClass TrimRight ()const{return StrConv(trimright);} ///<删除字符串后端的空格、换行等不可字符 SelfClass TrimRight ()const{return StrConv(trimright);} ///<删除字符串后端的空格、换行等不可字符
SelfClass Trim ()const{return StrConv(trim);} ///<删除字符串两端的空格、换行等不可字符 SelfClass Trim ()const{return StrConv(trim);} ///<删除字符串两端的空格、换行等不可字符
bool TrimLeft (int n){return Delete(0,n);} ///<删除字符串前端的指定个字符 bool TrimLeft (int n){return Delete(0,n);} ///<删除字符串前端的指定个字符
bool TrimRight (int n){return Unlink()?data->TrimRight(n):false;} ///<删除字符串后端的指定个字符 bool TrimRight (int n){return Unlink()?data->TrimRight(n):false;} ///<删除字符串后端的指定个字符
bool ClipLeft (int n){return Unlink()?data->ClipLeft(n):false;} ///<截取字符串前端的指定个字符,等同TrimRight(lengths-n)) bool ClipLeft (int n){return Unlink()?data->ClipLeft(n):false;} ///<截取字符串前端的指定个字符,等同TrimRight(length-n))
bool ClipRight (int n){return Delete(0,Length()-n);} ///<截取字符串后端的指定个字符,等同TrimLeft(length-n) bool ClipRight (int n){return Delete(0,Length()-n);} ///<截取字符串后端的指定个字符,等同TrimLeft(length-n)
bool Clip (uint pos,int num) ///<从指定位置删除指定个字符 bool Clip (uint pos,int num) ///<从指定位置删除指定个字符
{ {
@@ -932,7 +932,7 @@ namespace hgl
* @param sc 新的字符串 * @param sc 新的字符串
* @param start 起始字符索引 * @param start 起始字符索引
* @param n 字符数量 * @param n 字符数量
* @return 否成功 * @return 否成功
*/ */
bool SubString(SelfClass &sc,int start,int n) const ///<取字符串指定段的字符 bool SubString(SelfClass &sc,int start,int n) const ///<取字符串指定段的字符
{ {
@@ -1075,7 +1075,7 @@ namespace hgl
return(-1); return(-1);
} }
int FindExcludeChar(const T &ch)const{return FindExcludeChar(ch);} int FindExcludeChar(const T &ch)const{return FindExcludeChar(0,ch);}
/** /**
* 返回当前字符串中排除指定字符外的第一个字符的索引 * 返回当前字符串中排除指定字符外的第一个字符的索引
@@ -1141,7 +1141,7 @@ namespace hgl
T *tp=sub.c_str(); T *tp=sub.c_str();
T *p; T *p;
int len=data->GetLength(); int len=data->GetLength();
int sub_len=sub.Length; int sub_len=sub.Length();
int count=0; int count=0;
while((p=strstr(sp,tp))) while((p=strstr(sp,tp)))

View File

@@ -211,17 +211,17 @@ namespace hgl
} }
/** /**
* 确认字符串在,英文区分大小写 * 确认字符串在,英文区分大小写
*/ */
bool Exist(const StringClass &str) const ///<确认字符串在,英文区分大小写 bool Exist(const StringClass &str) const ///<确认字符串在,英文区分大小写
{ {
return Find(str)!=-1; return Find(str)!=-1;
} }
/** /**
* 确认字符串在,英文无视大小写 * 确认字符串在,英文无视大小写
*/ */
bool CaseExist(const StringClass &str) const ///<确认字符串在,英文无视大小写 bool CaseExist(const StringClass &str) const ///<确认字符串在,英文无视大小写
{ {
return CaseFind(str)!=-1; return CaseFind(str)!=-1;
} }