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>
This commit is contained in:
parent
21549529ef
commit
3a8aeef897
@ -3562,19 +3562,19 @@ QDataStream &operator>>(QDataStream &in, QByteArray &ba)
|
|||||||
/*!
|
/*!
|
||||||
\fn QByteArray QByteArray::simplified() const
|
\fn QByteArray QByteArray::simplified() const
|
||||||
|
|
||||||
Returns a byte array that has whitespace removed from the start
|
Returns a copy of this byte array that has spacing characters removed from
|
||||||
and the end, and which has each sequence of internal whitespace
|
the start and end, and in which each sequence of internal spacing characters
|
||||||
replaced with a single space.
|
is replaced with a single space.
|
||||||
|
|
||||||
Whitespace means any character for which the standard C++
|
The spacing characters are those for which the standard C++ \c isspace()
|
||||||
\c isspace() function returns \c true in the C locale. This includes the ASCII
|
function returns \c true in the C locale; these are the ASCII characters
|
||||||
isspace() function returns \c true in the C locale. This includes the ASCII
|
tabulation '\\t', line feed '\\n', carriage return '\\r', vertical
|
||||||
characters '\\t', '\\n', '\\v', '\\f', '\\r', and ' '.
|
tabulation '\\v', form feed '\\f', and space ' '.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
\snippet code/src_corelib_text_qbytearray.cpp 32
|
\snippet code/src_corelib_text_qbytearray.cpp 32
|
||||||
|
|
||||||
\sa trimmed()
|
\sa trimmed(), QChar::SpecialCharacter
|
||||||
*/
|
*/
|
||||||
QByteArray QByteArray::simplified_helper(const QByteArray &a)
|
QByteArray QByteArray::simplified_helper(const QByteArray &a)
|
||||||
{
|
{
|
||||||
@ -3589,19 +3589,21 @@ QByteArray QByteArray::simplified_helper(QByteArray &a)
|
|||||||
/*!
|
/*!
|
||||||
\fn QByteArray QByteArray::trimmed() const
|
\fn QByteArray QByteArray::trimmed() const
|
||||||
|
|
||||||
Returns a byte array that has whitespace removed from the start
|
Returns a copy of this byte array with spacing characters removed from the
|
||||||
and the end.
|
start and end.
|
||||||
|
|
||||||
Whitespace means any character for which the standard C++
|
The spacing characters are those for which the standard C++ \c isspace()
|
||||||
\c isspace() function returns \c true in the C locale. This includes the ASCII
|
function returns \c true in the C locale; these are the ASCII characters
|
||||||
characters '\\t', '\\n', '\\v', '\\f', '\\r', and ' '.
|
tabulation '\\t', line feed '\\n', carriage return '\\r', vertical
|
||||||
|
tabulation '\\v', form feed '\\f', and space ' '.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
\snippet code/src_corelib_text_qbytearray.cpp 33
|
\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)
|
QByteArray QByteArray::trimmed_helper(const QByteArray &a)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user