diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2014-07-19 10:23:40 +0200 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2014-07-19 10:23:40 +0200 |
| commit | 70e7b6005de3e4a2e0237f18196825d96f4ee4d3 (patch) | |
| tree | 1b017e68025534d194362a6dc206f04a2ca8f553 /src/base/QXmppVCardIq.cpp | |
| parent | 68f89992207c592cf0be8567d5c3d5e43157f9b6 (diff) | |
| parent | 07ae4a63307928e1af97b75b3de23530c74beb3f (diff) | |
| download | qxmpp-70e7b6005de3e4a2e0237f18196825d96f4ee4d3.tar.gz | |
Merge branch 'master' of github.com:qxmpp-project/qxmpp
Diffstat (limited to 'src/base/QXmppVCardIq.cpp')
| -rw-r--r-- | src/base/QXmppVCardIq.cpp | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/src/base/QXmppVCardIq.cpp b/src/base/QXmppVCardIq.cpp index 6d9f1fdb..4a237200 100644 --- a/src/base/QXmppVCardIq.cpp +++ b/src/base/QXmppVCardIq.cpp @@ -86,6 +86,25 @@ 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(); +} + +/// \brief Checks if two address objects represent different addresses. + +bool operator!=(const QXmppVCardAddress &left, const QXmppVCardAddress &right) +{ + return !(left == right); +} + /// Returns the country. QString QXmppVCardAddress::country() const @@ -250,6 +269,21 @@ QXmppVCardEmail& QXmppVCardEmail::operator=(const QXmppVCardEmail &other) return *this; } +/// \brief Checks if two email objects represent the same email address. + +bool operator==(const QXmppVCardEmail &left, const QXmppVCardEmail &right) +{ + return left.type() == right.type() && + left.address() == right.address(); +} + +/// \brief Checks if two email objects represent different email addresses. + +bool operator!=(const QXmppVCardEmail &left, const QXmppVCardEmail &right) +{ + return !(left == right); +} + /// Returns the e-mail address. QString QXmppVCardEmail::address() const @@ -353,6 +387,21 @@ QString QXmppVCardPhone::number() const return d->number; } +/// \brief Checks if two phone objects represent the same phone number. + +bool operator==(const QXmppVCardPhone &left, const QXmppVCardPhone &right) +{ + return left.type() == right.type() && + left.number() == right.number(); +} + +/// \brief Checks if two phone objects represent different phone numbers. + +bool operator!=(const QXmppVCardPhone &left, const QXmppVCardPhone &right) +{ + return !(left == right); +} + /// Sets the phone \a number. void QXmppVCardPhone::setNumber(const QString &number) @@ -475,6 +524,23 @@ QXmppVCardOrganization& QXmppVCardOrganization::operator=(const QXmppVCardOrgani return *this; } +/// \brief Checks if two organization objects represent the same organization. + +bool operator==(const QXmppVCardOrganization &left, const QXmppVCardOrganization &right) +{ + return left.organization() == right.organization() && + left.unit() == right.unit() && + left.title() == right.title() && + left.role() == right.role(); +} + +/// \brief Checks if two organization objects represent different organizations. + +bool operator!=(const QXmppVCardOrganization &left, const QXmppVCardOrganization &right) +{ + return !(left == right); +} + /// Returns the name of the organization. QString QXmppVCardOrganization::organization() const @@ -612,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. /// |
