1.fix List::GetBegin/GetEnd bug.

2.fix TextOutputStream bug
This commit is contained in:
2019-12-16 20:34:53 +08:00
parent e3a58db799
commit 51be93f2d7
3 changed files with 4 additions and 4 deletions

View File

@@ -123,7 +123,7 @@ namespace hgl
for(int i=0;i<count;i++) for(int i=0;i<count;i++)
{ {
const BaseString<T> &str=sl[i]; const T &str=sl.GetString(i);
const int len=str.Length(); const int len=str.Length();

View File

@@ -19,7 +19,7 @@ namespace hgl
template<typename T> template<typename T>
bool List<T>::Begin(T &ti)const bool List<T>::Begin(T &ti)const
{ {
if(!items) if(!items||count<=0)
return(false); return(false);
memcpy(&ti,items,sizeof(T)); memcpy(&ti,items,sizeof(T));
@@ -29,7 +29,7 @@ namespace hgl
template<typename T> template<typename T>
bool List<T>::End(T &ti)const bool List<T>::End(T &ti)const
{ {
if(!items) if(!items||count<=0)
return(false); return(false);
memcpy(&ti,items+count-1,sizeof(T)); memcpy(&ti,items+count-1,sizeof(T));

View File

@@ -205,7 +205,7 @@ namespace hgl
Items.Exchange(index1,index2); Items.Exchange(index1,index2);
} }
T &GetString(int n)const{return *(Items[n]);} ///<取得指定行字符串 const T &GetString(int n)const{return *(Items[n]);} ///<取得指定行字符串
};//template<typename T> class StringList };//template<typename T> class StringList
template<typename T> T StringList<T>::NullString; ///<空字符串实例 template<typename T> T StringList<T>::NullString; ///<空字符串实例