зеркало из https://github.com/mozilla/gecko-dev.git
rename |string_copy| and |string_copy_backward| to |copy_string| and |copy_string_backward|
This commit is contained in:
Родитель
8c2aa12cf4
Коммит
6c955bebcd
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче