summaryrefslogtreecommitdiffstats
path: root/src/network/ssl/qssldiffiehellmanparameters.h
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2020-10-30 14:23:27 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2020-10-30 17:27:29 +0100
commit57e57d9bcda868abcfb552e1247b391162c0dff9 (patch)
tree7752a32e796d74c8d01a447d1d7376a02cbf7fcc /src/network/ssl/qssldiffiehellmanparameters.h
parentd51d312c86128150283b6a41f0daac18d9e57f32 (diff)
Hide comparison operators for QtNetwork value types from non-ADL
Make them hidden friends, add a private isEqual helper where needed. Adjust and add documentation. Fixes: QTBUG-87976 Change-Id: If7c19eeab5be7452364eb76193981100f5516d6b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/network/ssl/qssldiffiehellmanparameters.h')
-rw-r--r--src/network/ssl/qssldiffiehellmanparameters.h39
1 files changed, 19 insertions, 20 deletions
diff --git a/src/network/ssl/qssldiffiehellmanparameters.h b/src/network/ssl/qssldiffiehellmanparameters.h
index 6a3cf01ddc..c65697796b 100644
--- a/src/network/ssl/qssldiffiehellmanparameters.h
+++ b/src/network/ssl/qssldiffiehellmanparameters.h
@@ -63,14 +63,7 @@ class QDebug;
Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QSslDiffieHellmanParameters &dhparams);
#endif
-Q_NETWORK_EXPORT bool operator==(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs) noexcept;
-
-inline bool operator!=(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs) noexcept
-{
- return !operator==(lhs, rhs);
-}
-
-class QSslDiffieHellmanParameters
+class Q_NETWORK_EXPORT QSslDiffieHellmanParameters
{
public:
enum Error {
@@ -79,30 +72,36 @@ public:
UnsafeParametersError
};
- Q_NETWORK_EXPORT static QSslDiffieHellmanParameters defaultParameters();
+ static QSslDiffieHellmanParameters defaultParameters();
- Q_NETWORK_EXPORT QSslDiffieHellmanParameters();
- Q_NETWORK_EXPORT QSslDiffieHellmanParameters(const QSslDiffieHellmanParameters &other);
+ QSslDiffieHellmanParameters();
+ QSslDiffieHellmanParameters(const QSslDiffieHellmanParameters &other);
QSslDiffieHellmanParameters(QSslDiffieHellmanParameters &&other) noexcept : d(other.d) { other.d = nullptr; }
- Q_NETWORK_EXPORT ~QSslDiffieHellmanParameters();
+ ~QSslDiffieHellmanParameters();
- Q_NETWORK_EXPORT QSslDiffieHellmanParameters &operator=(const QSslDiffieHellmanParameters &other);
+ QSslDiffieHellmanParameters &operator=(const QSslDiffieHellmanParameters &other);
QSslDiffieHellmanParameters &operator=(QSslDiffieHellmanParameters &&other) noexcept { swap(other); return *this; }
void swap(QSslDiffieHellmanParameters &other) noexcept { qSwap(d, other.d); }
- Q_NETWORK_EXPORT static QSslDiffieHellmanParameters fromEncoded(const QByteArray &encoded, QSsl::EncodingFormat format = QSsl::Pem);
- Q_NETWORK_EXPORT static QSslDiffieHellmanParameters fromEncoded(QIODevice *device, QSsl::EncodingFormat format = QSsl::Pem);
+ static QSslDiffieHellmanParameters fromEncoded(const QByteArray &encoded, QSsl::EncodingFormat format = QSsl::Pem);
+ static QSslDiffieHellmanParameters fromEncoded(QIODevice *device, QSsl::EncodingFormat format = QSsl::Pem);
- Q_NETWORK_EXPORT bool isEmpty() const noexcept;
- Q_NETWORK_EXPORT bool isValid() const noexcept;
- Q_NETWORK_EXPORT Error error() const noexcept;
- Q_NETWORK_EXPORT QString errorString() const noexcept;
+ bool isEmpty() const noexcept;
+ bool isValid() const noexcept;
+ Error error() const noexcept;
+ QString errorString() const noexcept;
private:
QSslDiffieHellmanParametersPrivate *d;
friend class QSslContext;
- friend Q_NETWORK_EXPORT bool operator==(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs) noexcept;
+
+ bool isEqual(const QSslDiffieHellmanParameters &other) const noexcept;
+ friend bool operator==(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs) noexcept
+ { return lhs.isEqual(rhs); }
+ friend bool operator!=(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs) noexcept
+ { return !lhs.isEqual(rhs); }
+
#ifndef QT_NO_DEBUG_STREAM
friend Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QSslDiffieHellmanParameters &dhparam);
#endif