QtNetwork: add member-swap to shared classes

Implemented as in other shared classes (e.g. QPen).

Change-Id: Ib3d87ff99603e617cc8810489f9f5e9fe054cd2a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
This commit is contained in:
Marc Mutz 2012-04-05 14:49:02 +02:00 committed by Qt by Nokia
parent 7d63fa6edc
commit b0aa023aa2
28 changed files with 202 additions and 0 deletions

View File

@ -148,6 +148,14 @@ QNetworkCacheMetaData &QNetworkCacheMetaData::operator=(const QNetworkCacheMetaD
return *this;
}
/*!
\fn void QNetworkCacheMetaData::swap(QNetworkCacheMetaData &other)
\since 5.0
Swaps this metadata instance with \a other. This function is very
fast and never fails.
*/
/*!
Returns true if this meta data is equal to the \a other meta data; otherwise returns false.

View File

@ -71,6 +71,10 @@ public:
~QNetworkCacheMetaData();
QNetworkCacheMetaData &operator=(const QNetworkCacheMetaData &other);
void swap(QNetworkCacheMetaData &other)
{ qSwap(d, other.d); }
bool operator==(const QNetworkCacheMetaData &other) const;
inline bool operator!=(const QNetworkCacheMetaData &other) const
{ return !(*this == other); }

View File

@ -124,6 +124,14 @@ QHttpPart &QHttpPart::operator=(const QHttpPart &other)
return *this;
}
/*!
\fn void QHttpPart::swap(QHttpPart &other)
\since 5.0
Swaps this HTTP part with \a other. This function is very fast and
never fails.
*/
/*!
Returns true if this object is the same as \a other (i.e., if they
have the same headers and body).

View File

@ -62,6 +62,9 @@ public:
QHttpPart(const QHttpPart &other);
~QHttpPart();
QHttpPart &operator=(const QHttpPart &other);
void swap(QHttpPart &other) { qSwap(d, other.d); }
bool operator==(const QHttpPart &other) const;
inline bool operator!=(const QHttpPart &other) const
{ return !operator==(other); }

View File

@ -143,6 +143,14 @@ QNetworkCookie &QNetworkCookie::operator=(const QNetworkCookie &other)
return *this;
}
/*!
\fn void QNetworkCookie::swap(QNetworkCookie &other)
\since 5.0
Swaps this cookie with \a other. This function is very fast and
never fails.
*/
/*!
\fn bool QNetworkCookie::operator!=(const QNetworkCookie &other) const

View File

@ -70,6 +70,9 @@ public:
QNetworkCookie(const QNetworkCookie &other);
~QNetworkCookie();
QNetworkCookie &operator=(const QNetworkCookie &other);
void swap(QNetworkCookie &other) { qSwap(d, other.d); }
bool operator==(const QNetworkCookie &other) const;
inline bool operator!=(const QNetworkCookie &other) const
{ return !(*this == other); }

View File

@ -395,6 +395,14 @@ QNetworkRequest &QNetworkRequest::operator=(const QNetworkRequest &other)
return *this;
}
/*!
\fn void QNetworkRequest::swap(QNetworkRequest &other)
\since 5.0
Swaps this network request with \a other. This function is very
fast and never fails.
*/
/*!
Returns the URL this network request is referring to.

View File

@ -114,6 +114,8 @@ public:
~QNetworkRequest();
QNetworkRequest &operator=(const QNetworkRequest &other);
inline void swap(QNetworkRequest &other) { qSwap(d, other.d); }
bool operator==(const QNetworkRequest &other) const;
inline bool operator!=(const QNetworkRequest &other) const
{ return !operator==(other); }

View File

@ -233,6 +233,14 @@ QNetworkConfiguration &QNetworkConfiguration::operator=(const QNetworkConfigurat
return *this;
}
/*!
\fn void QNetworkConfiguration::swap(QNetworkConfiguration &other)
\since 5.0
Swaps this network configuration with \a other. This function is
very fast and never fails.
*/
/*!
Returns true, if this configuration is the same as the \a other
configuration given; otherwise returns false.

View File

@ -61,6 +61,8 @@ public:
QNetworkConfiguration &operator=(const QNetworkConfiguration &other);
~QNetworkConfiguration();
void swap(QNetworkConfiguration &other) { qSwap(d, other.d); }
bool operator==(const QNetworkConfiguration &other) const;
inline bool operator!=(const QNetworkConfiguration &other) const
{ return !operator==(other); }

View File

@ -545,6 +545,12 @@ QDnsDomainNameRecord &QDnsDomainNameRecord::operator=(const QDnsDomainNameRecord
d = other.d;
return *this;
}
/*!
\fn void QDnsDomainNameRecord::swap(QDnsDomainNameRecord &other)
Swaps this domain-name record instance with \a other. This
function is very fast and never fails.
*/
/*!
\class QDnsHostAddressRecord
@ -623,6 +629,12 @@ QDnsHostAddressRecord &QDnsHostAddressRecord::operator=(const QDnsHostAddressRec
d = other.d;
return *this;
}
/*!
\fn void QDnsHostAddressRecord::swap(QDnsHostAddressRecord &other)
Swaps this host address record instance with \a other. This
function is very fast and never fails.
*/
/*!
\class QDnsMailExchangeRecord
@ -712,6 +724,12 @@ QDnsMailExchangeRecord &QDnsMailExchangeRecord::operator=(const QDnsMailExchange
d = other.d;
return *this;
}
/*!
\fn void QDnsMailExchangeRecord::swap(QDnsMailExchangeRecord &other)
Swaps this mail exchange record with \a other. This function is
very fast and never fails.
*/
/*!
\class QDnsServiceRecord
@ -826,6 +844,12 @@ QDnsServiceRecord &QDnsServiceRecord::operator=(const QDnsServiceRecord &other)
d = other.d;
return *this;
}
/*!
\fn void QDnsServiceRecord::swap(QDnsServiceRecord &other)
Swaps this service record instance with \a other. This function is
very fast and never fails.
*/
/*!
\class QDnsTextRecord
@ -906,6 +930,12 @@ QDnsTextRecord &QDnsTextRecord::operator=(const QDnsTextRecord &other)
d = other.d;
return *this;
}
/*!
\fn void QDnsTextRecord::swap(QDnsTextRecord &other)
Swaps this text record instance with \a other. This function is
very fast and never fails.
*/
void QDnsLookupPrivate::_q_lookupFinished(const QDnsLookupReply &_reply)
{

View File

@ -69,6 +69,8 @@ public:
QDnsDomainNameRecord(const QDnsDomainNameRecord &other);
~QDnsDomainNameRecord();
void swap(QDnsDomainNameRecord &other) { qSwap(d, other.d); }
QString name() const;
quint32 timeToLive() const;
QString value() const;
@ -87,6 +89,8 @@ public:
QDnsHostAddressRecord(const QDnsHostAddressRecord &other);
~QDnsHostAddressRecord();
void swap(QDnsHostAddressRecord &other) { qSwap(d, other.d); }
QString name() const;
quint32 timeToLive() const;
QHostAddress value() const;
@ -105,6 +109,8 @@ public:
QDnsMailExchangeRecord(const QDnsMailExchangeRecord &other);
~QDnsMailExchangeRecord();
void swap(QDnsMailExchangeRecord &other) { qSwap(d, other.d); }
QString exchange() const;
QString name() const;
quint16 preference() const;
@ -124,6 +130,8 @@ public:
QDnsServiceRecord(const QDnsServiceRecord &other);
~QDnsServiceRecord();
void swap(QDnsServiceRecord &other) { qSwap(d, other.d); }
QString name() const;
quint16 port() const;
quint16 priority() const;
@ -145,6 +153,8 @@ public:
QDnsTextRecord(const QDnsTextRecord &other);
~QDnsTextRecord();
void swap(QDnsTextRecord &other) { qSwap(d, other.d); }
QString name() const;
quint32 timeToLive() const;
QList<QByteArray> values() const;

View File

@ -184,6 +184,14 @@ QNetworkAddressEntry &QNetworkAddressEntry::operator=(const QNetworkAddressEntry
return *this;
}
/*!
\fn void QNetworkAddressEntry::swap(QNetworkAddressEntry &other)
\since 5.0
Swaps this network address entry instance with \a other. This
function is very fast and never fails.
*/
/*!
Destroys this QNetworkAddressEntry object.
*/
@ -416,6 +424,14 @@ QNetworkInterface &QNetworkInterface::operator=(const QNetworkInterface &other)
return *this;
}
/*!
\fn void QNetworkInterface::swap(QNetworkInterface &other)
\since 5.0
Swaps this network interface instance with \a other. This function
is very fast and never fails.
*/
/*!
Returns true if this QNetworkInterface object contains valid
information about a network interface.

View File

@ -63,6 +63,9 @@ public:
QNetworkAddressEntry(const QNetworkAddressEntry &other);
QNetworkAddressEntry &operator=(const QNetworkAddressEntry &other);
~QNetworkAddressEntry();
void swap(QNetworkAddressEntry &other) { qSwap(d, other.d); }
bool operator==(const QNetworkAddressEntry &other) const;
inline bool operator!=(const QNetworkAddressEntry &other) const
{ return !(*this == other); }
@ -101,6 +104,8 @@ public:
QNetworkInterface &operator=(const QNetworkInterface &other);
~QNetworkInterface();
void swap(QNetworkInterface &other) { qSwap(d, other.d); }
bool isValid() const;
int index() const;

View File

@ -510,6 +510,14 @@ QNetworkProxy &QNetworkProxy::operator=(const QNetworkProxy &other)
return *this;
}
/*!
\fn void QNetworkProxy::swap(QNetworkProxy &other)
\since 5.0
Swaps this network proxy instance with \a other. This function is
very fast and never fails.
*/
/*!
Sets the proxy type for this instance to be \a type.
@ -1131,6 +1139,14 @@ QNetworkProxyQuery &QNetworkProxyQuery::operator=(const QNetworkProxyQuery &othe
return *this;
}
/*!
\fn void QNetworkProxyQuery::swap(QNetworkProxyQuery &other)
\since 5.0
Swaps this network proxy query instance with \a other. This
function is very fast and never fails.
*/
/*!
Returns true if this QNetworkProxyQuery object contains the same
data as \a other.

View File

@ -86,6 +86,9 @@ public:
#endif
~QNetworkProxyQuery();
QNetworkProxyQuery &operator=(const QNetworkProxyQuery &other);
void swap(QNetworkProxyQuery &other) { qSwap(d, other.d); }
bool operator==(const QNetworkProxyQuery &other) const;
inline bool operator!=(const QNetworkProxyQuery &other) const
{ return !(*this == other); }
@ -147,6 +150,9 @@ public:
QNetworkProxy(const QNetworkProxy &other);
QNetworkProxy &operator=(const QNetworkProxy &other);
~QNetworkProxy();
void swap(QNetworkProxy &other) { qSwap(d, other.d); }
bool operator==(const QNetworkProxy &other) const;
inline bool operator!=(const QNetworkProxy &other) const
{ return !(*this == other); }

View File

@ -190,6 +190,14 @@ QSslCertificate &QSslCertificate::operator=(const QSslCertificate &other)
return *this;
}
/*!
\fn void QSslCertificate::swap(QSslCertificate &other)
\since 5.0
Swaps this certificate instance with \a other. This function is
very fast and never fails.
*/
/*!
Returns true if this certificate is the same as \a other; otherwise
returns false.

View File

@ -87,6 +87,10 @@ public:
QSslCertificate(const QSslCertificate &other);
~QSslCertificate();
QSslCertificate &operator=(const QSslCertificate &other);
inline void swap(QSslCertificate &other)
{ qSwap(d, other.d); }
bool operator==(const QSslCertificate &other) const;
inline bool operator!=(const QSslCertificate &other) const { return !operator==(other); }

View File

@ -165,6 +165,13 @@ QSslCertificateExtension &QSslCertificateExtension::operator=(const QSslCertific
return *this;
}
/*!
\fn void QSslCertificateExtension::swap(QSslCertificateExtension &other)
Swaps this certificate extension instance with \a other. This
function is very fast and never fails.
*/
/*!
Returns the ASN.1 OID of this extension.
*/

View File

@ -65,6 +65,8 @@ public:
QSslCertificateExtension &operator=(const QSslCertificateExtension &other);
void swap(QSslCertificateExtension &other) { qSwap(d, other.d); }
QString oid() const;
QString name() const;
QVariant value() const;

View File

@ -123,6 +123,14 @@ QSslCipher &QSslCipher::operator=(const QSslCipher &other)
return *this;
}
/*!
\fn void QSslCipher::swap(QSslCipher &other)
\since 5.0
Swaps this cipher instance with \a other. This function is very
fast and never fails.
*/
/*!
Returns true if this cipher is the same as \a other; otherwise,
false is returned.

View File

@ -63,6 +63,10 @@ public:
QSslCipher(const QSslCipher &other);
~QSslCipher();
QSslCipher &operator=(const QSslCipher &other);
inline void swap(QSslCipher &other)
{ qSwap(d, other.d); }
bool operator==(const QSslCipher &other) const;
inline bool operator!=(const QSslCipher &other) const { return !operator==(other); }

View File

@ -148,6 +148,14 @@ QSslConfiguration &QSslConfiguration::operator=(const QSslConfiguration &other)
return *this;
}
/*!
\fn void QSslConfiguration::swap(QSslConfiguration &other)
\since 5.0
Swaps this SSL configuration instance with \a other. This function
is very fast and never fails.
*/
/*!
Returns true if this QSslConfiguration object is equal to \a
other.

View File

@ -82,6 +82,9 @@ public:
~QSslConfiguration();
QSslConfiguration &operator=(const QSslConfiguration &other);
inline void swap(QSslConfiguration &other)
{ qSwap(d, other.d); }
bool operator==(const QSslConfiguration &other) const;
inline bool operator!=(const QSslConfiguration &other) const
{ return !(*this == other); }

View File

@ -172,6 +172,14 @@ QSslError &QSslError::operator=(const QSslError &other)
return *this;
}
/*!
\fn void QSslError::swap(QSslError &other)
\since 5.0
Swaps this error instance with \a other. This function is very
fast and never fails.
*/
/*!
\since 4.4

View File

@ -94,6 +94,9 @@ public:
QSslError(const QSslError &other);
inline void swap(QSslError &other)
{ qSwap(d, other.d); }
~QSslError();
QSslError &operator=(const QSslError &other);
bool operator==(const QSslError &other) const;

View File

@ -312,6 +312,14 @@ QSslKey &QSslKey::operator=(const QSslKey &other)
return *this;
}
/*!
\fn void QSslKey::swap(QSslKey &other)
\since 5.0
Swaps this ssl key with \a other. This function is very fast and
never fails.
*/
/*!
Returns true if this is a null key; otherwise false.

View File

@ -77,6 +77,8 @@ public:
~QSslKey();
QSslKey &operator=(const QSslKey &other);
inline void swap(QSslKey &other) { qSwap(d, other.d); }
bool isNull() const;
void clear();