diff --git a/mozilla/string/public/nsAWritableString.h b/mozilla/string/public/nsAWritableString.h index dcce0dd6339..a779642d621 100644 --- a/mozilla/string/public/nsAWritableString.h +++ b/mozilla/string/public/nsAWritableString.h @@ -179,6 +179,17 @@ class nsWritingIterator return *this; } + + PRUint32 + write( const value_type* s, PRUint32 n ) + { + NS_ASSERTION(size_forward() > 0, "You can't |write| into an |nsWritingIterator| with no space!"); + + n = NS_MIN(n, PRUint32(size_forward())); + nsCharTraits::copy(mPosition, s, n); + operator+=( difference_type(n) ); + return n; + } }; diff --git a/mozilla/xpcom/ds/nsAWritableString.h b/mozilla/xpcom/ds/nsAWritableString.h index dcce0dd6339..a779642d621 100644 --- a/mozilla/xpcom/ds/nsAWritableString.h +++ b/mozilla/xpcom/ds/nsAWritableString.h @@ -179,6 +179,17 @@ class nsWritingIterator return *this; } + + PRUint32 + write( const value_type* s, PRUint32 n ) + { + NS_ASSERTION(size_forward() > 0, "You can't |write| into an |nsWritingIterator| with no space!"); + + n = NS_MIN(n, PRUint32(size_forward())); + nsCharTraits::copy(mPosition, s, n); + operator+=( difference_type(n) ); + return n; + } }; diff --git a/mozilla/xpcom/string/public/nsAWritableString.h b/mozilla/xpcom/string/public/nsAWritableString.h index dcce0dd6339..a779642d621 100644 --- a/mozilla/xpcom/string/public/nsAWritableString.h +++ b/mozilla/xpcom/string/public/nsAWritableString.h @@ -179,6 +179,17 @@ class nsWritingIterator return *this; } + + PRUint32 + write( const value_type* s, PRUint32 n ) + { + NS_ASSERTION(size_forward() > 0, "You can't |write| into an |nsWritingIterator| with no space!"); + + n = NS_MIN(n, PRUint32(size_forward())); + nsCharTraits::copy(mPosition, s, n); + operator+=( difference_type(n) ); + return n; + } };