diff options
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp')
-rw-r--r-- | Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp b/Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp index bb09469..79e543e 100644 --- a/Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp @@ -19,41 +19,41 @@ namespace Swift { VCardSerializer::VCardSerializer() : GenericPayloadSerializer<VCard>() { } -String VCardSerializer::serializePayload(boost::shared_ptr<VCard> vcard) const { +std::string VCardSerializer::serializePayload(boost::shared_ptr<VCard> vcard) const { XMLElement queryElement("vCard", "vcard-temp"); - if (!vcard->getVersion().isEmpty()) { + if (!vcard->getVersion().empty()) { boost::shared_ptr<XMLElement> versionElement(new XMLElement("VERSION")); versionElement->addNode(boost::shared_ptr<XMLTextNode>(new XMLTextNode(vcard->getVersion()))); queryElement.addNode(versionElement); } - if (!vcard->getFullName().isEmpty()) { + if (!vcard->getFullName().empty()) { boost::shared_ptr<XMLElement> fullNameElement(new XMLElement("FN")); fullNameElement->addNode(boost::shared_ptr<XMLTextNode>(new XMLTextNode(vcard->getFullName()))); queryElement.addNode(fullNameElement); } - if (!vcard->getGivenName().isEmpty() || !vcard->getFamilyName().isEmpty() || !vcard->getMiddleName().isEmpty() || !vcard->getPrefix().isEmpty() || !vcard->getSuffix().isEmpty()) { + if (!vcard->getGivenName().empty() || !vcard->getFamilyName().empty() || !vcard->getMiddleName().empty() || !vcard->getPrefix().empty() || !vcard->getSuffix().empty()) { boost::shared_ptr<XMLElement> nameElement(new XMLElement("N")); - if (!vcard->getFamilyName().isEmpty()) { + if (!vcard->getFamilyName().empty()) { boost::shared_ptr<XMLElement> familyNameElement(new XMLElement("FAMILY")); familyNameElement->addNode(boost::shared_ptr<XMLTextNode>(new XMLTextNode(vcard->getFamilyName()))); nameElement->addNode(familyNameElement); } - if (!vcard->getGivenName().isEmpty()) { + if (!vcard->getGivenName().empty()) { boost::shared_ptr<XMLElement> givenNameElement(new XMLElement("GIVEN")); givenNameElement->addNode(boost::shared_ptr<XMLTextNode>(new XMLTextNode(vcard->getGivenName()))); nameElement->addNode(givenNameElement); } - if (!vcard->getMiddleName().isEmpty()) { + if (!vcard->getMiddleName().empty()) { boost::shared_ptr<XMLElement> middleNameElement(new XMLElement("MIDDLE")); middleNameElement->addNode(boost::shared_ptr<XMLTextNode>(new XMLTextNode(vcard->getMiddleName()))); nameElement->addNode(middleNameElement); } - if (!vcard->getPrefix().isEmpty()) { + if (!vcard->getPrefix().empty()) { boost::shared_ptr<XMLElement> prefixElement(new XMLElement("PREFIX")); prefixElement->addNode(boost::shared_ptr<XMLTextNode>(new XMLTextNode(vcard->getPrefix()))); nameElement->addNode(prefixElement); } - if (!vcard->getSuffix().isEmpty()) { + if (!vcard->getSuffix().empty()) { boost::shared_ptr<XMLElement> suffixElement(new XMLElement("SUFFIX")); suffixElement->addNode(boost::shared_ptr<XMLTextNode>(new XMLTextNode(vcard->getSuffix()))); nameElement->addNode(suffixElement); @@ -82,14 +82,14 @@ String VCardSerializer::serializePayload(boost::shared_ptr<VCard> vcard) const } queryElement.addNode(emailElement); } - if (!vcard->getNickname().isEmpty()) { + if (!vcard->getNickname().empty()) { boost::shared_ptr<XMLElement> nickElement(new XMLElement("NICKNAME")); nickElement->addNode(boost::shared_ptr<XMLTextNode>(new XMLTextNode(vcard->getNickname()))); queryElement.addNode(nickElement); } - if (!vcard->getPhoto().isEmpty() || !vcard->getPhotoType().isEmpty()) { + if (!vcard->getPhoto().isEmpty() || !vcard->getPhotoType().empty()) { XMLElement::ref photoElement(new XMLElement("PHOTO")); - if (!vcard->getPhotoType().isEmpty()) { + if (!vcard->getPhotoType().empty()) { XMLElement::ref typeElement(new XMLElement("TYPE")); typeElement->addNode(XMLTextNode::ref(new XMLTextNode(vcard->getPhotoType()))); photoElement->addNode(typeElement); @@ -101,7 +101,7 @@ String VCardSerializer::serializePayload(boost::shared_ptr<VCard> vcard) const } queryElement.addNode(photoElement); } - if (!vcard->getUnknownContent().isEmpty()) { + if (!vcard->getUnknownContent().empty()) { queryElement.addNode(boost::shared_ptr<XMLRawTextNode>(new XMLRawTextNode(vcard->getUnknownContent()))); } return queryElement.serialize(); |