From 0a29b964e3910bb69f08902f9b38253a86d4619e Mon Sep 17 00:00:00 2001 From: hyzboy Date: Fri, 25 Jul 2025 01:30:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=B0=91=E9=87=8Fbug?= =?UTF-8?q?=EF=BC=8C=E6=94=B9=E8=BF=9B=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/hgl/thread/RingBuffer.h | 2 +- inc/hgl/type/String.h | 16 ++++++++-------- inc/hgl/type/StringList.h | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/inc/hgl/thread/RingBuffer.h b/inc/hgl/thread/RingBuffer.h index 1cd8927..3a0e4af 100644 --- a/inc/hgl/thread/RingBuffer.h +++ b/inc/hgl/thread/RingBuffer.h @@ -43,7 +43,7 @@ namespace hgl RingBuffer(int); ///<本类构造函数 virtual ~RingBuffer(); ///<本类析构函数 - const int GetBufferSize()const{return buffer_size;} ///<除取缓冲区长度 + const int GetBufferSize()const{return buffer_size;} ///<获取缓冲区长度 void Clear(); ///<清除整个缓冲区 void SafeClear(); ///<安全清除整个缓冲区 diff --git a/inc/hgl/type/String.h b/inc/hgl/type/String.h index 0520b7a..b99b3e5 100644 --- a/inc/hgl/type/String.h +++ b/inc/hgl/type/String.h @@ -725,7 +725,7 @@ namespace hgl return bs.Length(); } - if(bs.Length<=0) + if(bs.Length()<=0) return 1; return data->CaseComp(bs.data->c_str(),num); @@ -891,14 +891,14 @@ namespace hgl public: - SelfClass TrimLeft ()const{return StrConv(trimleft);} ///<删除字符串前端的空格、换行等不可视字符串 - SelfClass TrimRight ()const{return StrConv(trimright);} ///<删除字符串后端的空格、换行等不可视字符串 - SelfClass Trim ()const{return StrConv(trim);} ///<删除字符串两端的空格、换行等不可视字符串 + SelfClass TrimLeft ()const{return StrConv(trimleft);} ///<删除字符串前端的空格、换行等不可见字符 + SelfClass TrimRight ()const{return StrConv(trimright);} ///<删除字符串后端的空格、换行等不可见字符 + SelfClass Trim ()const{return StrConv(trim);} ///<删除字符串两端的空格、换行等不可见字符 bool TrimLeft (int n){return Delete(0,n);} ///<删除字符串前端的指定个字符 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 Clip (uint pos,int num) ///<从指定位置删除指定个字符 { @@ -932,7 +932,7 @@ namespace hgl * @param sc 新的字符串 * @param start 起始字符索引 * @param n 字符数量 - * @return 成否成功 + * @return 是否成功 */ bool SubString(SelfClass &sc,int start,int n) const ///<取字符串指定段的字符 { @@ -1075,7 +1075,7 @@ namespace hgl 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 *p; int len=data->GetLength(); - int sub_len=sub.Length; + int sub_len=sub.Length(); int count=0; while((p=strstr(sp,tp))) diff --git a/inc/hgl/type/StringList.h b/inc/hgl/type/StringList.h index 322c951..71a36b6 100644 --- a/inc/hgl/type/StringList.h +++ b/inc/hgl/type/StringList.h @@ -211,17 +211,17 @@ namespace hgl } /** - * 确认字符串确在,英文区分大小写 + * 确认字符串存在,英文区分大小写 */ - bool Exist(const StringClass &str) const ///<确认字符串确在,英文区分大小写 + bool Exist(const StringClass &str) const ///<确认字符串存在,英文区分大小写 { return Find(str)!=-1; } /** - * 确认字符串确在,英文无视大小写 + * 确认字符串存在,英文无视大小写 */ - bool CaseExist(const StringClass &str) const ///<确认字符串确在,英文无视大小写 + bool CaseExist(const StringClass &str) const ///<确认字符串存在,英文无视大小写 { return CaseFind(str)!=-1; }