diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-02-14 18:57:18 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-02-14 21:36:32 (GMT) |
commit | cb05f5a908e20006c954ce38755c2e422ecc2388 (patch) | |
tree | a793551a5fe279a57d4330119560e8542f745484 /Swiften/Serializer/XMPPSerializer.cpp | |
parent | cad974b45c0fb9355e68d9728e42c9ae3dbcebc7 (diff) | |
download | swift-contrib-cb05f5a908e20006c954ce38755c2e422ecc2388.zip swift-contrib-cb05f5a908e20006c954ce38755c2e422ecc2388.tar.bz2 |
Removed Swift::String.
Diffstat (limited to 'Swiften/Serializer/XMPPSerializer.cpp')
-rw-r--r-- | Swiften/Serializer/XMPPSerializer.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Swiften/Serializer/XMPPSerializer.cpp b/Swiften/Serializer/XMPPSerializer.cpp index ad84152..06f3558 100644 --- a/Swiften/Serializer/XMPPSerializer.cpp +++ b/Swiften/Serializer/XMPPSerializer.cpp @@ -61,25 +61,25 @@ XMPPSerializer::XMPPSerializer(PayloadSerializerCollection* payloadSerializers, serializers_.push_back(boost::make_shared<ComponentHandshakeSerializer>()); } -String XMPPSerializer::serializeHeader(const ProtocolHeader& header) const { - String result = "<?xml version=\"1.0\"?><stream:stream xmlns=\"" + getDefaultNamespace() + "\" xmlns:stream=\"http://etherx.jabber.org/streams\""; - if (!header.getFrom().isEmpty()) { +std::string XMPPSerializer::serializeHeader(const ProtocolHeader& header) const { + std::string result = "<?xml version=\"1.0\"?><stream:stream xmlns=\"" + getDefaultNamespace() + "\" xmlns:stream=\"http://etherx.jabber.org/streams\""; + if (!header.getFrom().empty()) { result += " from=\"" + header.getFrom() + "\""; } - if (!header.getTo().isEmpty()) { + if (!header.getTo().empty()) { result += " to=\"" + header.getTo() + "\""; } - if (!header.getID().isEmpty()) { + if (!header.getID().empty()) { result += " id=\"" + header.getID() + "\""; } - if (!header.getVersion().isEmpty()) { + if (!header.getVersion().empty()) { result += " version=\"" + header.getVersion() + "\""; } result += ">"; return result; } -String XMPPSerializer::serializeElement(boost::shared_ptr<Element> element) const { +std::string XMPPSerializer::serializeElement(boost::shared_ptr<Element> element) const { std::vector< boost::shared_ptr<ElementSerializer> >::const_iterator i = std::find_if( serializers_.begin(), serializers_.end(), boost::bind(&ElementSerializer::canSerialize, _1, element)); @@ -92,11 +92,11 @@ String XMPPSerializer::serializeElement(boost::shared_ptr<Element> element) cons } } -String XMPPSerializer::serializeFooter() const { +std::string XMPPSerializer::serializeFooter() const { return "</stream:stream>"; } -String XMPPSerializer::getDefaultNamespace() const { +std::string XMPPSerializer::getDefaultNamespace() const { switch (type_) { case ClientStreamType: return "jabber:client"; case ServerStreamType: return "jabber:server"; |