diff options
| author | 0xd34df00d <0xd34df00d@gmail.com> | 2014-04-23 17:29:21 +0400 |
|---|---|---|
| committer | 0xd34df00d <0xd34df00d@gmail.com> | 2014-04-23 17:29:21 +0400 |
| commit | 1db9e5ebf34895c610d97f9f61718781f7b69923 (patch) | |
| tree | e2a248a3c2ee4d4c00a3593ebad329ad28529b20 /src/base | |
| parent | 721d34cf7955274d788a50ac1976b5f2577ef050 (diff) | |
| download | qxmpp-1db9e5ebf34895c610d97f9f61718781f7b69923.tar.gz | |
Added equality ops for QXmppVCardIq.
Diffstat (limited to 'src/base')
| -rw-r--r-- | src/base/QXmppVCardIq.cpp | 28 | ||||
| -rw-r--r-- | src/base/QXmppVCardIq.h | 3 |
2 files changed, 31 insertions, 0 deletions
diff --git a/src/base/QXmppVCardIq.cpp b/src/base/QXmppVCardIq.cpp index 8733256b..4a237200 100644 --- a/src/base/QXmppVCardIq.cpp +++ b/src/base/QXmppVCardIq.cpp @@ -678,6 +678,34 @@ QXmppVCardIq& QXmppVCardIq::operator=(const QXmppVCardIq &other) return *this; } +/// \brief Checks if two VCard objects represent the same VCard. + +bool operator==(const QXmppVCardIq &left, const QXmppVCardIq &right) +{ + return left.birthday() == right.birthday() && + left.description() == right.description() && + left.email() == right.email() && + left.firstName() == right.firstName() && + left.fullName() == right.fullName() && + left.lastName() == right.lastName() && + left.middleName() == right.middleName() && + left.nickName() == right.nickName() && + left.photo() == right.photo() && + left.photoType() == right.photoType() && + left.url() == right.url() && + left.addresses() == right.addresses() && + left.emails() == right.emails() && + left.phones() == right.phones() && + left.organization() == right.organization(); +} + +/// \brief Checks if two VCard objects represent different VCards. + +bool operator!=(const QXmppVCardIq &left, const QXmppVCardIq &right) +{ + return !(left == right); +} + /// Returns the date of birth of the individual associated with the vCard. /// diff --git a/src/base/QXmppVCardIq.h b/src/base/QXmppVCardIq.h index dc3a1f78..966ff632 100644 --- a/src/base/QXmppVCardIq.h +++ b/src/base/QXmppVCardIq.h @@ -291,4 +291,7 @@ private: QSharedDataPointer<QXmppVCardIqPrivate> d; }; +QXMPP_EXPORT bool operator==(const QXmppVCardIq&, const QXmppVCardIq&); +QXMPP_EXPORT bool operator!=(const QXmppVCardIq&, const QXmppVCardIq&); + #endif // QXMPPVCARDIQ_H |
