Skip to content

Commit

Permalink
Update QRestReply documentation
Browse files Browse the repository at this point in the history
To accommodate the deduplication and non-owning changes
in previous commit.

Resulted from API-review

Change-Id: Ie1c4e9959c1ba7e8ed2be6607d9f6497ae15af39
Reviewed-by: Ivan Solovev <[email protected]>
(cherry picked from commit efa178d)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
  • Loading branch information
Juha Vuolle authored and Qt Cherry-pick Bot committed Jan 30, 2024
1 parent afc1f2a commit 7fd7674
Showing 1 changed file with 38 additions and 8 deletions.
46 changes: 38 additions & 8 deletions src/network/access/qrestreply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,31 @@ Q_DECLARE_LOGGING_CATEGORY(lcQrest)
/*!
\class QRestReply
\since 6.7
\brief QRestReply is the class for following up the requests sent with
QRestAccessManager.
\brief QRestReply is a convenience wrapper for QNetworkReply.
\reentrant
\ingroup network
\inmodule QtNetwork
\preliminary
QRestReply is a convenience class for typical RESTful client
applications. It wraps the more detailed QNetworkReply and provides
convenience methods for data and status handling.
QRestReply wraps a QNetworkReply and provides convenience methods for data
and status handling. The methods provide convenience for typical RESTful
client applications.
\sa QRestAccessManager, QNetworkReply
QRestReply doesn't take ownership of the wrapped QNetworkReply, and the
lifetime and ownership of the reply is as defined by QNetworkAccessManager
documentation.
QRestReply object is not copyable, but is movable.
\sa QRestAccessManager, QNetworkReply, QNetworkAccessManager,
QNetworkAccessManager::setAutoDeleteReplies()
*/

/*!
Creates a QRestReply and initializes the wrapped QNetworkReply to \a reply.
*/
QRestReply::QRestReply(QNetworkReply *reply)
: wrapped(reply)
{
Expand All @@ -50,6 +59,26 @@ QRestReply::~QRestReply()
delete d;
}

/*!
\fn QRestReply::QRestReply(QRestReply &&other) noexcept
Move-constructs the reply from \a other.
\note The moved-from object \a other is placed in a
partially-formed state, in which the only valid operations are
destruction and assignment of a new value.
*/

/*!
\fn QRestReply &QRestReply::operator=(QRestReply &&other) noexcept
Move-assigns \a other and returns a reference to this reply.
\note The moved-from object \a other is placed in a
partially-formed state, in which the only valid operations are
destruction and assignment of a new value.
*/

/*!
Returns a pointer to the underlying QNetworkReply wrapped by this object.
*/
Expand Down Expand Up @@ -106,7 +135,8 @@ std::optional<QJsonDocument> QRestReply::json(QJsonParseError *error)
calls to get response data will return empty until further data has been
received.
\sa json(), text(), bytesAvailable(), readyRead()
\sa json(), text(), QNetworkReply::bytesAvailable(),
QNetworkReply::readyRead()
*/
QByteArray QRestReply::body()
{
Expand All @@ -127,7 +157,7 @@ QByteArray QRestReply::body()
decoding is not supported by \l QStringConverter, or if the decoding
has errors (for example invalid characters).
\sa json(), body(), isFinished(), finished()
\sa json(), body(), QNetworkReply::readyRead()
*/
QString QRestReply::text()
{
Expand Down

0 comments on commit 7fd7674

Please sign in to comment.