Doc: Improve documentation about append, prepend
The references to the this pointer look somewhat alien in the documentation, because it isn't part of the signature. Rather make the relationship explicit. Change-Id: I6de516e165ea6e9c4ee2898836e9490fbaf4545c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
7051572618
commit
627f0a7f7d
@ -1516,13 +1516,13 @@ void QByteArray::chop(int n)
|
|||||||
\snippet code/src_corelib_tools_qbytearray.cpp 12
|
\snippet code/src_corelib_tools_qbytearray.cpp 12
|
||||||
|
|
||||||
Note: QByteArray is an \l{implicitly shared} class. Consequently,
|
Note: QByteArray is an \l{implicitly shared} class. Consequently,
|
||||||
if \e this is an empty QByteArray, then \e this will just share
|
if you append to an empty byte array, then the byte array will just
|
||||||
the data held in \a ba. In this case, no copying of data is done,
|
share the data held in \a ba. In this case, no copying of data is done,
|
||||||
taking \l{constant time}. If a shared instance is modified, it will
|
taking \l{constant time}. If a shared instance is modified, it will
|
||||||
be copied (copy-on-write), taking \l{linear time}.
|
be copied (copy-on-write), taking \l{linear time}.
|
||||||
|
|
||||||
If \e this is not an empty QByteArray, a deep copy of the data is
|
If the byte array being appended to is not empty, a deep copy of the
|
||||||
performed, taking \l{linear time}.
|
data is performed, taking \l{linear time}.
|
||||||
|
|
||||||
This operation typically does not suffer from allocation overhead,
|
This operation typically does not suffer from allocation overhead,
|
||||||
because QByteArray preallocates extra space at the end of the data
|
because QByteArray preallocates extra space at the end of the data
|
||||||
@ -1781,13 +1781,13 @@ QByteArray QByteArray::nulTerminated() const
|
|||||||
This is the same as insert(0, \a ba).
|
This is the same as insert(0, \a ba).
|
||||||
|
|
||||||
Note: QByteArray is an \l{implicitly shared} class. Consequently,
|
Note: QByteArray is an \l{implicitly shared} class. Consequently,
|
||||||
if \e this is an empty QByteArray, then \e this will just share
|
if you prepend to an empty byte array, then the byte array will just
|
||||||
the data held in \a ba. In this case, no copying of data is done,
|
share the data held in \a ba. In this case, no copying of data is done,
|
||||||
taking \l{constant time}. If a shared instance is modified, it will
|
taking \l{constant time}. If a shared instance is modified, it will
|
||||||
be copied (copy-on-write), taking \l{linear time}.
|
be copied (copy-on-write), taking \l{linear time}.
|
||||||
|
|
||||||
If \e this is not an empty QByteArray, a deep copy of the data is
|
If the byte array being prepended to is not empty, a deep copy of the
|
||||||
performed, taking \l{linear time}.
|
data is performed, taking \l{linear time}.
|
||||||
|
|
||||||
\sa append(), insert()
|
\sa append(), insert()
|
||||||
*/
|
*/
|
||||||
@ -1869,13 +1869,13 @@ QByteArray &QByteArray::prepend(char ch)
|
|||||||
This is the same as insert(size(), \a ba).
|
This is the same as insert(size(), \a ba).
|
||||||
|
|
||||||
Note: QByteArray is an \l{implicitly shared} class. Consequently,
|
Note: QByteArray is an \l{implicitly shared} class. Consequently,
|
||||||
if \e this is an empty QByteArray, then \e this will just share
|
if you append to an empty byte array, then the byte array will just
|
||||||
the data held in \a ba. In this case, no copying of data is done,
|
share the data held in \a ba. In this case, no copying of data is done,
|
||||||
taking \l{constant time}. If a shared instance is modified, it will
|
taking \l{constant time}. If a shared instance is modified, it will
|
||||||
be copied (copy-on-write), taking \l{linear time}.
|
be copied (copy-on-write), taking \l{linear time}.
|
||||||
|
|
||||||
If \e this is not an empty QByteArray, a deep copy of the data is
|
If the byte array being appended to is not empty, a deep copy of the
|
||||||
performed, taking \l{linear time}.
|
data is performed, taking \l{linear time}.
|
||||||
|
|
||||||
This operation typically does not suffer from allocation overhead,
|
This operation typically does not suffer from allocation overhead,
|
||||||
because QByteArray preallocates extra space at the end of the data
|
because QByteArray preallocates extra space at the end of the data
|
||||||
|
Loading…
Reference in New Issue
Block a user