nsAString::iterator writer; PRUint32 oldLength = aDest.Length(); aDest.SetLength(oldLength + Distance(aSrcStart, aSrcEnd)); aDest.BeginWriting(writer).advance(oldLength); nsScannerIterator fromBegin(aSrcStart);  copy_string(fromBegin, aSrcEnd, writer);
if (aDest.str().IsEmpty()) {   aDest.Rebind(aSrcStart, aSrcEnd); } else {  AppendUnicodeTo(aSrcStart, aSrcEnd, aDest.writable()); }
AppendUnicodeTo( const nsScannerIterator& aSrcStart,                 const nsScannerIterator& aSrcEnd,                 nsAString& aDest )  {    nsAString::iterator writer;    PRUint32 oldLength = aDest.Length();    aDest.SetLength(oldLength + Distance(aSrcStart, aSrcEnd));    aDest.BeginWriting(writer).advance(oldLength);    nsScannerIterator fromBegin(aSrcStart);        copy_string(fromBegin, aSrcEnd, writer);  }