aboutsummaryrefslogtreecommitdiff
path: root/src/base
diff options
context:
space:
mode:
author0xd34df00d <0xd34df00d@gmail.com>2014-04-23 16:48:18 +0400
committer0xd34df00d <0xd34df00d@gmail.com>2014-04-23 16:48:18 +0400
commit4e2ae6954c20b0b7e3a9845d2331e68695153726 (patch)
treea9a7843362dc082e3e5d6f97926a5a2de5bcd248 /src/base
parentc94d62a1df697b2ab7701f89c1aaa9b4c981ad0f (diff)
downloadqxmpp-4e2ae6954c20b0b7e3a9845d2331e68695153726.tar.gz
Added operator== and != for QXmppVCardAddress.
Diffstat (limited to 'src/base')
-rw-r--r--src/base/QXmppVCardIq.cpp17
-rw-r--r--src/base/QXmppVCardIq.h3
2 files changed, 20 insertions, 0 deletions
diff --git a/src/base/QXmppVCardIq.cpp b/src/base/QXmppVCardIq.cpp
index 6d9f1fdb..7701b60a 100644
--- a/src/base/QXmppVCardIq.cpp
+++ b/src/base/QXmppVCardIq.cpp
@@ -86,6 +86,23 @@ QXmppVCardAddress& QXmppVCardAddress::operator=(const QXmppVCardAddress &other)
return *this;
}
+/// \brief Checks if two address objects represent the same address.
+
+bool operator==(const QXmppVCardAddress &left, const QXmppVCardAddress &right)
+{
+ return left.type() == right.type() &&
+ left.country() == right.country() &&
+ left.locality() == right.locality() &&
+ left.postcode() == right.postcode() &&
+ left.region() == right.region() &&
+ left.street() == right.street();
+}
+
+bool operator!=(const QXmppVCardAddress &left, const QXmppVCardAddress &right)
+{
+ return !(left == right);
+}
+
/// Returns the country.
QString QXmppVCardAddress::country() const
diff --git a/src/base/QXmppVCardIq.h b/src/base/QXmppVCardIq.h
index cb54b91d..ae0e7efc 100644
--- a/src/base/QXmppVCardIq.h
+++ b/src/base/QXmppVCardIq.h
@@ -84,6 +84,9 @@ private:
QSharedDataPointer<QXmppVCardAddressPrivate> d;
};
+QXMPP_EXPORT bool operator==(const QXmppVCardAddress&, const QXmppVCardAddress&);
+QXMPP_EXPORT bool operator!=(const QXmppVCardAddress&, const QXmppVCardAddress&);
+
/// \brief Represents a vCard e-mail address.
class QXMPP_EXPORT QXmppVCardEmail