support new trim/trimleft/trimright

This commit is contained in:
hyzboy 2020-09-03 11:06:04 +08:00
parent 0b6e12c471
commit b37c9439e3

View File

@ -857,7 +857,7 @@ namespace hgl
protected: protected:
typedef T *(*ConvFunc)(const T *,int &); typedef const T *(*ConvFunc)(const T *,int &);
bool StrConv(ConvFunc conv) bool StrConv(ConvFunc conv)
{ {
@ -866,11 +866,11 @@ namespace hgl
int new_len=data->GetLength(); int new_len=data->GetLength();
T *new_str=conv(data->c_str(),new_len); const T *new_str=conv(data->c_str(),new_len);
if(new_len>0) if(new_len>0)
{ {
SetString(SelfClass::newOf(new_str,new_len)); SetString(new_str,new_len);
return(true); return(true);
} }
else else