diff options
author | hjk <hjk121@nokiamail.com> | 2013-04-23 11:25:33 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-23 18:57:45 +0200 |
commit | 649da796f54dd291c1b0e3c5b02a44cd34006a44 (patch) | |
tree | 6fa98b3c8da3f01263fbcdaa275dedda8bcd4aa9 | |
parent | 32629676b977d98e853fc6101a63c0d888ff5598 (diff) |
QDataStream: Be a bit more verbose about operator>>(char *&)
This also fixes a few "sloppy" mentionings of "new" into "new []".
Task-number: QTBUG-30777
Change-Id: I3f4add07777b59cd09cac97b672c73273b3b97eb
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
-rw-r--r-- | src/corelib/io/qdatastream.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/corelib/io/qdatastream.cpp b/src/corelib/io/qdatastream.cpp index ae9b667b58..dc7387bc85 100644 --- a/src/corelib/io/qdatastream.cpp +++ b/src/corelib/io/qdatastream.cpp @@ -816,8 +816,12 @@ QDataStream &QDataStream::operator>>(double &f) Reads the '\\0'-terminated string \a s from the stream and returns a reference to the stream. - Space for the string is allocated using \c new -- the caller must - destroy it with \c{delete[]}. + The string is deserialized using \c{readBytes()}. + + Space for the string is allocated using \c{new []} -- the caller must + destroy it with \c{delete []}. + + \sa readBytes(), readRawData() */ QDataStream &QDataStream::operator>>(char *&s) @@ -831,8 +835,8 @@ QDataStream &QDataStream::operator>>(char *&s) Reads the buffer \a s from the stream and returns a reference to the stream. - The buffer \a s is allocated using \c new. Destroy it with the \c - delete[] operator. + The buffer \a s is allocated using \c{new []}. Destroy it with the + \c{delete []} operator. The \a l parameter is set to the length of the buffer. If the string read is empty, \a l is set to 0 and \a s is set to @@ -1101,7 +1105,9 @@ QDataStream &QDataStream::operator<<(double f) Writes the '\\0'-terminated string \a s to the stream and returns a reference to the stream. - The string is serialized using writeBytes(). + The string is serialized using \c{writeBytes()}. + + \sa writeBytes(), writeRawData() */ QDataStream &QDataStream::operator<<(const char *s) |