//-------------------------------------------------------------------------------------------------------------- //字符串数组类和字符串数组类不相等比较 bool StringArray::operator != ( const StringArray& refStringArray ) const { Iterator sit = refStringArray.Begin(); Iterator send = refStringArray.End(); Iterator dit = mStringList.Begin(); for(; sit!=send; ++sit, ++dit ) { if( *dit != *sit ) return true; } return false; }
//-------------------------------------------------------------------------------------------------------------- //字符串数组类和字符串数组类相连 StringArray StringArray::operator + ( const StringArray& refStringArray ) const { UINT NumThis = mStringList.Size(); UINT NumAdd = refStringArray.mStringList.Size(); UINT NumDst = NumThis + NumAdd; //复制本字符串数组到返回字符串数组中 StringArray DstStringArray( NumDst, 10 ); DstStringArray = refStringArray; //将添加的字符串数组中的字符串添加到返回字符串数组中 Iterator it = refStringArray.Begin(); Iterator end = refStringArray.End(); for(; it!=end; ++it ) { DstStringArray.Push( *it ); } return DstStringArray; }