rename |string_copy| and |string_copy_backward| to |copy_string| and |copy_string_backward|

This commit is contained in:
scc%netscape.com 2000-03-29 00:54:12 +00:00
Родитель 8c2aa12cf4
Коммит 6c955bebcd
9 изменённых файлов: 45 добавлений и 45 удалений

Просмотреть файл

@ -898,7 +898,7 @@ nsPromiseSubstring<CharT>::GetReadableFragment( nsReadableFragment<CharT>& aFrag
template <class InputIterator, class OutputIterator>
OutputIterator
string_copy( InputIterator first, InputIterator last, OutputIterator result )
copy_string( InputIterator first, InputIterator last, OutputIterator result )
{
while ( first != last )
{
@ -906,7 +906,7 @@ string_copy( InputIterator first, InputIterator last, OutputIterator result )
if ( first.fragment().mStart == last.fragment().mStart )
lengthToCopy = NS_MIN(lengthToCopy, PRUint32(last.operator->() - first.operator->()));
NS_ASSERTION(lengthToCopy, "|string_copy| will never terminate");
NS_ASSERTION(lengthToCopy, "|copy_string| will never terminate");
nsCharTraits<InputIterator::value_type>::copy(result.operator->(), first.operator->(), lengthToCopy);
@ -919,7 +919,7 @@ string_copy( InputIterator first, InputIterator last, OutputIterator result )
template <class InputIterator, class CharT>
CharT*
string_copy( InputIterator first, InputIterator last, CharT* result )
copy_string( InputIterator first, InputIterator last, CharT* result )
{
while ( first != last )
{
@ -927,7 +927,7 @@ string_copy( InputIterator first, InputIterator last, CharT* result )
if ( first.fragment().mStart == last.fragment().mStart )
lengthToCopy = NS_MIN(lengthToCopy, PRUint32(last.operator->() - first.operator->()));
NS_ASSERTION(lengthToCopy, "|string_copy| will never terminate");
NS_ASSERTION(lengthToCopy, "|copy_string| will never terminate");
nsCharTraits<CharT>::copy(result, first.operator->(), lengthToCopy);
@ -940,7 +940,7 @@ string_copy( InputIterator first, InputIterator last, CharT* result )
template <class InputIterator, class OutputIterator>
OutputIterator
string_copy_backward( InputIterator first, InputIterator last, OutputIterator result )
copy_string_backward( InputIterator first, InputIterator last, OutputIterator result )
{
while ( first != last )
{
@ -948,7 +948,7 @@ string_copy_backward( InputIterator first, InputIterator last, OutputIterator re
if ( first.fragment().mStart == last.fragment().mStart )
lengthToCopy = NS_MIN(lengthToCopy, PRUint32(last.operator->() - first.operator->()));
NS_ASSERTION(lengthToCopy, "|string_copy_backward| will never terminate");
NS_ASSERTION(lengthToCopy, "|copy_string_backward| will never terminate");
nsCharTraits<InputIterator::value_type>::move(result.operator->()-lengthToCopy, last.operator->()-lengthToCopy, lengthToCopy);

Просмотреть файл

@ -340,7 +340,7 @@ void
basic_nsAWritableString<CharT>::Assign( const basic_nsAReadableString<CharT>& rhs )
{
SetLength(rhs.Length());
string_copy(rhs.BeginReading(), rhs.EndReading(), BeginWriting());
copy_string(rhs.BeginReading(), rhs.EndReading(), BeginWriting());
}
template <class CharT>
@ -349,7 +349,7 @@ basic_nsAWritableString<CharT>::Append( const basic_nsAReadableString<CharT>& rh
{
PRUint32 oldLength = Length();
SetLength(oldLength + rhs.Length());
string_copy(rhs.BeginReading(), rhs.EndReading(), BeginWriting(oldLength));
copy_string(rhs.BeginReading(), rhs.EndReading(), BeginWriting(oldLength));
}
template <class CharT>
@ -367,17 +367,17 @@ basic_nsAWritableString<CharT>::Insert( const basic_nsAReadableString<CharT>& aR
PRUint32 oldLength = Length();
SetLength(oldLength + aReadable.Length());
if ( aPosition < oldLength )
string_copy_backward(BeginReading(aPosition), BeginReading(oldLength), EndWriting());
copy_string_backward(BeginReading(aPosition), BeginReading(oldLength), EndWriting());
else
aPosition = oldLength;
string_copy(aReadable.BeginReading(), aReadable.EndReading(), BeginWriting(aPosition));
copy_string(aReadable.BeginReading(), aReadable.EndReading(), BeginWriting(aPosition));
}
template <class CharT>
void
basic_nsAWritableString<CharT>::Cut( PRUint32 cutStart, PRUint32 cutLength )
{
string_copy(BeginReading(cutStart+cutLength), EndReading(), BeginWriting(cutStart));
copy_string(BeginReading(cutStart+cutLength), EndReading(), BeginWriting(cutStart));
SetLength(Length()-cutLength);
}
@ -397,12 +397,12 @@ basic_nsAWritableString<CharT>::Replace( PRUint32 cutStart, PRUint32 cutLength,
PRUint32 newLength = oldLength - cutLength + replacementLength;
if ( cutLength > replacementLength )
string_copy(BeginReading(cutEnd), EndReading(), BeginWriting(replacementEnd));
copy_string(BeginReading(cutEnd), EndReading(), BeginWriting(replacementEnd));
SetLength(newLength);
if ( cutLength < replacementLength )
string_copy_backward(BeginReading(cutEnd), BeginReading(oldLength), BeginWriting(replacementEnd));
copy_string_backward(BeginReading(cutEnd), BeginReading(oldLength), BeginWriting(replacementEnd));
string_copy(aReplacement.BeginReading(), aReplacement.EndReading(), BeginWriting(cutStart));
copy_string(aReplacement.BeginReading(), aReplacement.EndReading(), BeginWriting(cutStart));
}
// operator>>

Просмотреть файл

@ -126,7 +126,7 @@ new_nsSharedString( const basic_nsAReadableString<CharT>& aReadable )
{
typedef CharT* CharT_ptr;
CharT* string_ptr = CharT_ptr(NS_STATIC_CAST(unsigned char*, object_ptr) + object_size);
string_copy(aReadable.BeginReading(), aReadable.EndReading(), string_ptr);
copy_string(aReadable.BeginReading(), aReadable.EndReading(), string_ptr);
return new (object_ptr) basic_nsSharedString<CharT>(string_ptr, string_length);
}

Просмотреть файл

@ -898,7 +898,7 @@ nsPromiseSubstring<CharT>::GetReadableFragment( nsReadableFragment<CharT>& aFrag
template <class InputIterator, class OutputIterator>
OutputIterator
string_copy( InputIterator first, InputIterator last, OutputIterator result )
copy_string( InputIterator first, InputIterator last, OutputIterator result )
{
while ( first != last )
{
@ -906,7 +906,7 @@ string_copy( InputIterator first, InputIterator last, OutputIterator result )
if ( first.fragment().mStart == last.fragment().mStart )
lengthToCopy = NS_MIN(lengthToCopy, PRUint32(last.operator->() - first.operator->()));
NS_ASSERTION(lengthToCopy, "|string_copy| will never terminate");
NS_ASSERTION(lengthToCopy, "|copy_string| will never terminate");
nsCharTraits<InputIterator::value_type>::copy(result.operator->(), first.operator->(), lengthToCopy);
@ -919,7 +919,7 @@ string_copy( InputIterator first, InputIterator last, OutputIterator result )
template <class InputIterator, class CharT>
CharT*
string_copy( InputIterator first, InputIterator last, CharT* result )
copy_string( InputIterator first, InputIterator last, CharT* result )
{
while ( first != last )
{
@ -927,7 +927,7 @@ string_copy( InputIterator first, InputIterator last, CharT* result )
if ( first.fragment().mStart == last.fragment().mStart )
lengthToCopy = NS_MIN(lengthToCopy, PRUint32(last.operator->() - first.operator->()));
NS_ASSERTION(lengthToCopy, "|string_copy| will never terminate");
NS_ASSERTION(lengthToCopy, "|copy_string| will never terminate");
nsCharTraits<CharT>::copy(result, first.operator->(), lengthToCopy);
@ -940,7 +940,7 @@ string_copy( InputIterator first, InputIterator last, CharT* result )
template <class InputIterator, class OutputIterator>
OutputIterator
string_copy_backward( InputIterator first, InputIterator last, OutputIterator result )
copy_string_backward( InputIterator first, InputIterator last, OutputIterator result )
{
while ( first != last )
{
@ -948,7 +948,7 @@ string_copy_backward( InputIterator first, InputIterator last, OutputIterator re
if ( first.fragment().mStart == last.fragment().mStart )
lengthToCopy = NS_MIN(lengthToCopy, PRUint32(last.operator->() - first.operator->()));
NS_ASSERTION(lengthToCopy, "|string_copy_backward| will never terminate");
NS_ASSERTION(lengthToCopy, "|copy_string_backward| will never terminate");
nsCharTraits<InputIterator::value_type>::move(result.operator->()-lengthToCopy, last.operator->()-lengthToCopy, lengthToCopy);

Просмотреть файл

@ -340,7 +340,7 @@ void
basic_nsAWritableString<CharT>::Assign( const basic_nsAReadableString<CharT>& rhs )
{
SetLength(rhs.Length());
string_copy(rhs.BeginReading(), rhs.EndReading(), BeginWriting());
copy_string(rhs.BeginReading(), rhs.EndReading(), BeginWriting());
}
template <class CharT>
@ -349,7 +349,7 @@ basic_nsAWritableString<CharT>::Append( const basic_nsAReadableString<CharT>& rh
{
PRUint32 oldLength = Length();
SetLength(oldLength + rhs.Length());
string_copy(rhs.BeginReading(), rhs.EndReading(), BeginWriting(oldLength));
copy_string(rhs.BeginReading(), rhs.EndReading(), BeginWriting(oldLength));
}
template <class CharT>
@ -367,17 +367,17 @@ basic_nsAWritableString<CharT>::Insert( const basic_nsAReadableString<CharT>& aR
PRUint32 oldLength = Length();
SetLength(oldLength + aReadable.Length());
if ( aPosition < oldLength )
string_copy_backward(BeginReading(aPosition), BeginReading(oldLength), EndWriting());
copy_string_backward(BeginReading(aPosition), BeginReading(oldLength), EndWriting());
else
aPosition = oldLength;
string_copy(aReadable.BeginReading(), aReadable.EndReading(), BeginWriting(aPosition));
copy_string(aReadable.BeginReading(), aReadable.EndReading(), BeginWriting(aPosition));
}
template <class CharT>
void
basic_nsAWritableString<CharT>::Cut( PRUint32 cutStart, PRUint32 cutLength )
{
string_copy(BeginReading(cutStart+cutLength), EndReading(), BeginWriting(cutStart));
copy_string(BeginReading(cutStart+cutLength), EndReading(), BeginWriting(cutStart));
SetLength(Length()-cutLength);
}
@ -397,12 +397,12 @@ basic_nsAWritableString<CharT>::Replace( PRUint32 cutStart, PRUint32 cutLength,
PRUint32 newLength = oldLength - cutLength + replacementLength;
if ( cutLength > replacementLength )
string_copy(BeginReading(cutEnd), EndReading(), BeginWriting(replacementEnd));
copy_string(BeginReading(cutEnd), EndReading(), BeginWriting(replacementEnd));
SetLength(newLength);
if ( cutLength < replacementLength )
string_copy_backward(BeginReading(cutEnd), BeginReading(oldLength), BeginWriting(replacementEnd));
copy_string_backward(BeginReading(cutEnd), BeginReading(oldLength), BeginWriting(replacementEnd));
string_copy(aReplacement.BeginReading(), aReplacement.EndReading(), BeginWriting(cutStart));
copy_string(aReplacement.BeginReading(), aReplacement.EndReading(), BeginWriting(cutStart));
}
// operator>>

Просмотреть файл

@ -126,7 +126,7 @@ new_nsSharedString( const basic_nsAReadableString<CharT>& aReadable )
{
typedef CharT* CharT_ptr;
CharT* string_ptr = CharT_ptr(NS_STATIC_CAST(unsigned char*, object_ptr) + object_size);
string_copy(aReadable.BeginReading(), aReadable.EndReading(), string_ptr);
copy_string(aReadable.BeginReading(), aReadable.EndReading(), string_ptr);
return new (object_ptr) basic_nsSharedString<CharT>(string_ptr, string_length);
}

Просмотреть файл

@ -898,7 +898,7 @@ nsPromiseSubstring<CharT>::GetReadableFragment( nsReadableFragment<CharT>& aFrag
template <class InputIterator, class OutputIterator>
OutputIterator
string_copy( InputIterator first, InputIterator last, OutputIterator result )
copy_string( InputIterator first, InputIterator last, OutputIterator result )
{
while ( first != last )
{
@ -906,7 +906,7 @@ string_copy( InputIterator first, InputIterator last, OutputIterator result )
if ( first.fragment().mStart == last.fragment().mStart )
lengthToCopy = NS_MIN(lengthToCopy, PRUint32(last.operator->() - first.operator->()));
NS_ASSERTION(lengthToCopy, "|string_copy| will never terminate");
NS_ASSERTION(lengthToCopy, "|copy_string| will never terminate");
nsCharTraits<InputIterator::value_type>::copy(result.operator->(), first.operator->(), lengthToCopy);
@ -919,7 +919,7 @@ string_copy( InputIterator first, InputIterator last, OutputIterator result )
template <class InputIterator, class CharT>
CharT*
string_copy( InputIterator first, InputIterator last, CharT* result )
copy_string( InputIterator first, InputIterator last, CharT* result )
{
while ( first != last )
{
@ -927,7 +927,7 @@ string_copy( InputIterator first, InputIterator last, CharT* result )
if ( first.fragment().mStart == last.fragment().mStart )
lengthToCopy = NS_MIN(lengthToCopy, PRUint32(last.operator->() - first.operator->()));
NS_ASSERTION(lengthToCopy, "|string_copy| will never terminate");
NS_ASSERTION(lengthToCopy, "|copy_string| will never terminate");
nsCharTraits<CharT>::copy(result, first.operator->(), lengthToCopy);
@ -940,7 +940,7 @@ string_copy( InputIterator first, InputIterator last, CharT* result )
template <class InputIterator, class OutputIterator>
OutputIterator
string_copy_backward( InputIterator first, InputIterator last, OutputIterator result )
copy_string_backward( InputIterator first, InputIterator last, OutputIterator result )
{
while ( first != last )
{
@ -948,7 +948,7 @@ string_copy_backward( InputIterator first, InputIterator last, OutputIterator re
if ( first.fragment().mStart == last.fragment().mStart )
lengthToCopy = NS_MIN(lengthToCopy, PRUint32(last.operator->() - first.operator->()));
NS_ASSERTION(lengthToCopy, "|string_copy_backward| will never terminate");
NS_ASSERTION(lengthToCopy, "|copy_string_backward| will never terminate");
nsCharTraits<InputIterator::value_type>::move(result.operator->()-lengthToCopy, last.operator->()-lengthToCopy, lengthToCopy);

Просмотреть файл

@ -340,7 +340,7 @@ void
basic_nsAWritableString<CharT>::Assign( const basic_nsAReadableString<CharT>& rhs )
{
SetLength(rhs.Length());
string_copy(rhs.BeginReading(), rhs.EndReading(), BeginWriting());
copy_string(rhs.BeginReading(), rhs.EndReading(), BeginWriting());
}
template <class CharT>
@ -349,7 +349,7 @@ basic_nsAWritableString<CharT>::Append( const basic_nsAReadableString<CharT>& rh
{
PRUint32 oldLength = Length();
SetLength(oldLength + rhs.Length());
string_copy(rhs.BeginReading(), rhs.EndReading(), BeginWriting(oldLength));
copy_string(rhs.BeginReading(), rhs.EndReading(), BeginWriting(oldLength));
}
template <class CharT>
@ -367,17 +367,17 @@ basic_nsAWritableString<CharT>::Insert( const basic_nsAReadableString<CharT>& aR
PRUint32 oldLength = Length();
SetLength(oldLength + aReadable.Length());
if ( aPosition < oldLength )
string_copy_backward(BeginReading(aPosition), BeginReading(oldLength), EndWriting());
copy_string_backward(BeginReading(aPosition), BeginReading(oldLength), EndWriting());
else
aPosition = oldLength;
string_copy(aReadable.BeginReading(), aReadable.EndReading(), BeginWriting(aPosition));
copy_string(aReadable.BeginReading(), aReadable.EndReading(), BeginWriting(aPosition));
}
template <class CharT>
void
basic_nsAWritableString<CharT>::Cut( PRUint32 cutStart, PRUint32 cutLength )
{
string_copy(BeginReading(cutStart+cutLength), EndReading(), BeginWriting(cutStart));
copy_string(BeginReading(cutStart+cutLength), EndReading(), BeginWriting(cutStart));
SetLength(Length()-cutLength);
}
@ -397,12 +397,12 @@ basic_nsAWritableString<CharT>::Replace( PRUint32 cutStart, PRUint32 cutLength,
PRUint32 newLength = oldLength - cutLength + replacementLength;
if ( cutLength > replacementLength )
string_copy(BeginReading(cutEnd), EndReading(), BeginWriting(replacementEnd));
copy_string(BeginReading(cutEnd), EndReading(), BeginWriting(replacementEnd));
SetLength(newLength);
if ( cutLength < replacementLength )
string_copy_backward(BeginReading(cutEnd), BeginReading(oldLength), BeginWriting(replacementEnd));
copy_string_backward(BeginReading(cutEnd), BeginReading(oldLength), BeginWriting(replacementEnd));
string_copy(aReplacement.BeginReading(), aReplacement.EndReading(), BeginWriting(cutStart));
copy_string(aReplacement.BeginReading(), aReplacement.EndReading(), BeginWriting(cutStart));
}
// operator>>

Просмотреть файл

@ -126,7 +126,7 @@ new_nsSharedString( const basic_nsAReadableString<CharT>& aReadable )
{
typedef CharT* CharT_ptr;
CharT* string_ptr = CharT_ptr(NS_STATIC_CAST(unsigned char*, object_ptr) + object_size);
string_copy(aReadable.BeginReading(), aReadable.EndReading(), string_ptr);
copy_string(aReadable.BeginReading(), aReadable.EndReading(), string_ptr);
return new (object_ptr) basic_nsSharedString<CharT>(string_ptr, string_length);
}