summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2020-05-29 13:23:55 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2020-06-04 10:39:53 +0200
commit3a8aeef897ce6d0e97e597953a9db308b910bbe6 (patch)
tree3c4821acc76d833556ac23b2e903a3610ba7e0a6
parent21549529ef0e80c3dae28b4d7ea9a8ffb859f351 (diff)
QByteArray: clean up docs of trimmed() and simplified()
Make the set of spacing characters explicit (rather than "includes" hinting that there might be more) and makes explicit that this is an ASCII operation. Change-Id: I61b543bcb450ee82bcce980ecb469901e287b46f Reviewed-by: Paul Wicking <paul.wicking@qt.io>
-rw-r--r--src/corelib/text/qbytearray.cpp32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/corelib/text/qbytearray.cpp b/src/corelib/text/qbytearray.cpp
index cdaf247992..193cca515d 100644
--- a/src/corelib/text/qbytearray.cpp
+++ b/src/corelib/text/qbytearray.cpp
@@ -3562,19 +3562,19 @@ QDataStream &operator>>(QDataStream &in, QByteArray &ba)
/*!
\fn QByteArray QByteArray::simplified() const
- Returns a byte array that has whitespace removed from the start
- and the end, and which has each sequence of internal whitespace
- replaced with a single space.
+ Returns a copy of this byte array that has spacing characters removed from
+ the start and end, and in which each sequence of internal spacing characters
+ is replaced with a single space.
- Whitespace means any character for which the standard C++
- \c isspace() function returns \c true in the C locale. This includes the ASCII
- isspace() function returns \c true in the C locale. This includes the ASCII
- characters '\\t', '\\n', '\\v', '\\f', '\\r', and ' '.
+ The spacing characters are those for which the standard C++ \c isspace()
+ function returns \c true in the C locale; these are the ASCII characters
+ tabulation '\\t', line feed '\\n', carriage return '\\r', vertical
+ tabulation '\\v', form feed '\\f', and space ' '.
Example:
\snippet code/src_corelib_text_qbytearray.cpp 32
- \sa trimmed()
+ \sa trimmed(), QChar::SpecialCharacter
*/
QByteArray QByteArray::simplified_helper(const QByteArray &a)
{
@@ -3589,19 +3589,21 @@ QByteArray QByteArray::simplified_helper(QByteArray &a)
/*!
\fn QByteArray QByteArray::trimmed() const
- Returns a byte array that has whitespace removed from the start
- and the end.
+ Returns a copy of this byte array with spacing characters removed from the
+ start and end.
- Whitespace means any character for which the standard C++
- \c isspace() function returns \c true in the C locale. This includes the ASCII
- characters '\\t', '\\n', '\\v', '\\f', '\\r', and ' '.
+ The spacing characters are those for which the standard C++ \c isspace()
+ function returns \c true in the C locale; these are the ASCII characters
+ tabulation '\\t', line feed '\\n', carriage return '\\r', vertical
+ tabulation '\\v', form feed '\\f', and space ' '.
Example:
\snippet code/src_corelib_text_qbytearray.cpp 33
- Unlike simplified(), \l {QByteArray::trimmed()}{trimmed()} leaves internal whitespace alone.
+ Unlike simplified(), \l {QByteArray::trimmed()}{trimmed()} leaves internal
+ spacing unchanged.
- \sa simplified()
+ \sa simplified(), QChar::SpecialCharacter
*/
QByteArray QByteArray::trimmed_helper(const QByteArray &a)
{