summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-02-14 18:57:18 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-02-14 21:36:32 (GMT)
commitcb05f5a908e20006c954ce38755c2e422ecc2388 (patch)
treea793551a5fe279a57d4330119560e8542f745484 /Swiften/Serializer
parentcad974b45c0fb9355e68d9728e42c9ae3dbcebc7 (diff)
downloadswift-contrib-cb05f5a908e20006c954ce38755c2e422ecc2388.zip
swift-contrib-cb05f5a908e20006c954ce38755c2e422ecc2388.tar.bz2
Removed Swift::String.
Diffstat (limited to 'Swiften/Serializer')
-rw-r--r--Swiften/Serializer/AuthChallengeSerializer.cpp4
-rw-r--r--Swiften/Serializer/AuthChallengeSerializer.h2
-rw-r--r--Swiften/Serializer/AuthFailureSerializer.h2
-rw-r--r--Swiften/Serializer/AuthRequestSerializer.cpp4
-rw-r--r--Swiften/Serializer/AuthRequestSerializer.h2
-rw-r--r--Swiften/Serializer/AuthResponseSerializer.cpp4
-rw-r--r--Swiften/Serializer/AuthResponseSerializer.h2
-rw-r--r--Swiften/Serializer/AuthSuccessSerializer.cpp4
-rw-r--r--Swiften/Serializer/AuthSuccessSerializer.h2
-rw-r--r--Swiften/Serializer/ComponentHandshakeSerializer.cpp2
-rw-r--r--Swiften/Serializer/ComponentHandshakeSerializer.h2
-rw-r--r--Swiften/Serializer/CompressFailureSerializer.h2
-rw-r--r--Swiften/Serializer/CompressRequestSerializer.cpp2
-rw-r--r--Swiften/Serializer/CompressRequestSerializer.h2
-rw-r--r--Swiften/Serializer/ElementSerializer.h4
-rw-r--r--Swiften/Serializer/EnableStreamManagementSerializer.h2
-rw-r--r--Swiften/Serializer/GenericElementSerializer.h2
-rw-r--r--Swiften/Serializer/GenericPayloadSerializer.h4
-rw-r--r--Swiften/Serializer/GenericStanzaSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializerCollection.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/BodySerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.cpp2
-rw-r--r--Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.cpp2
-rw-r--r--Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/ChatStateSerializer.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/ChatStateSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/CommandSerializer.cpp26
-rw-r--r--Swiften/Serializer/PayloadSerializers/CommandSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp11
-rw-r--r--Swiften/Serializer/PayloadSerializers/DelaySerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/DiscoItemsSerializer.cpp6
-rw-r--r--Swiften/Serializer/PayloadSerializers/DiscoItemsSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/ErrorSerializer.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/ErrorSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/FormSerializer.cpp45
-rw-r--r--Swiften/Serializer/PayloadSerializers/FormSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/IBBSerializer.cpp2
-rw-r--r--Swiften/Serializer/PayloadSerializers/IBBSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/InBandRegistrationPayloadSerializer.cpp2
-rw-r--r--Swiften/Serializer/PayloadSerializers/InBandRegistrationPayloadSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/MUCOwnerPayloadSerializer.cpp2
-rw-r--r--Swiften/Serializer/PayloadSerializers/MUCOwnerPayloadSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.cpp7
-rw-r--r--Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.cpp10
-rw-r--r--Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.h6
-rw-r--r--Swiften/Serializer/PayloadSerializers/NicknameSerializer.cpp2
-rw-r--r--Swiften/Serializer/PayloadSerializers/NicknameSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/PrioritySerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/PrivateStorageSerializer.cpp2
-rw-r--r--Swiften/Serializer/PayloadSerializers/PrivateStorageSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/RawXMLPayloadSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/ResourceBindSerializer.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/ResourceBindSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/RosterSerializer.cpp6
-rw-r--r--Swiften/Serializer/PayloadSerializers/RosterSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/SearchPayloadSerializer.cpp2
-rw-r--r--Swiften/Serializer/PayloadSerializers/SearchPayloadSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.cpp10
-rw-r--r--Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.cpp10
-rw-r--r--Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/StartSessionSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/StatusSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/StatusShowSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/StorageSerializer.cpp6
-rw-r--r--Swiften/Serializer/PayloadSerializers/StorageSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.cpp10
-rw-r--r--Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/SubjectSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/CapsInfoSerializerTest.cpp2
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/DiscoInfoSerializerTest.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/ErrorSerializerTest.cpp2
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/FormSerializerTest.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/InBandRegistrationPayloadSerializerTest.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.cpp2
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/PrioritySerializerTest.cpp2
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/PrivateStorageSerializerTest.cpp2
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/ResourceBindSerializerTest.cpp6
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/RosterSerializerTest.cpp6
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/SearchPayloadSerializerTest.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelSerializerTest.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelsCatalogSerializerTest.cpp2
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/SoftwareVersionSerializerTest.cpp2
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/StatusSerializerTest.cpp2
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/StatusShowSerializerTest.cpp12
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/StorageSerializerTest.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/StreamInitiationSerializerTest.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/VCardSerializerTest.cpp2
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/VCardUpdateSerializerTest.cpp2
-rw-r--r--Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp26
-rw-r--r--Swiften/Serializer/PayloadSerializers/VCardSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/VCardUpdateSerializer.cpp2
-rw-r--r--Swiften/Serializer/PayloadSerializers/VCardUpdateSerializer.h2
-rw-r--r--Swiften/Serializer/StanzaAckRequestSerializer.h2
-rw-r--r--Swiften/Serializer/StanzaAckSerializer.h4
-rw-r--r--Swiften/Serializer/StanzaSerializer.cpp10
-rw-r--r--Swiften/Serializer/StanzaSerializer.h8
-rw-r--r--Swiften/Serializer/StartTLSFailureSerializer.h2
-rw-r--r--Swiften/Serializer/StartTLSRequestSerializer.h2
-rw-r--r--Swiften/Serializer/StreamErrorSerializer.cpp6
-rw-r--r--Swiften/Serializer/StreamErrorSerializer.h2
-rw-r--r--Swiften/Serializer/StreamFeaturesSerializer.cpp6
-rw-r--r--Swiften/Serializer/StreamFeaturesSerializer.h2
-rw-r--r--Swiften/Serializer/StreamManagementEnabledSerializer.h2
-rw-r--r--Swiften/Serializer/StreamManagementFailedSerializer.h2
-rw-r--r--Swiften/Serializer/TLSProceedSerializer.h2
-rw-r--r--Swiften/Serializer/UnitTest/AuthChallengeSerializerTest.cpp6
-rw-r--r--Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp6
-rw-r--r--Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp6
-rw-r--r--Swiften/Serializer/UnitTest/AuthSuccessSerializerTest.cpp6
-rw-r--r--Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp2
-rw-r--r--Swiften/Serializer/UnitTest/XMPPSerializerTest.cpp6
-rw-r--r--Swiften/Serializer/XML/UnitTest/XMLElementTest.cpp10
-rw-r--r--Swiften/Serializer/XML/XMLElement.cpp26
-rw-r--r--Swiften/Serializer/XML/XMLElement.h12
-rw-r--r--Swiften/Serializer/XML/XMLNode.h4
-rw-r--r--Swiften/Serializer/XML/XMLRawTextNode.h6
-rw-r--r--Swiften/Serializer/XML/XMLTextNode.h16
-rw-r--r--Swiften/Serializer/XMPPSerializer.cpp18
-rw-r--r--Swiften/Serializer/XMPPSerializer.h10
128 files changed, 312 insertions, 309 deletions
diff --git a/Swiften/Serializer/AuthChallengeSerializer.cpp b/Swiften/Serializer/AuthChallengeSerializer.cpp
index 883763f..dcded43 100644
--- a/Swiften/Serializer/AuthChallengeSerializer.cpp
+++ b/Swiften/Serializer/AuthChallengeSerializer.cpp
@@ -14,9 +14,9 @@ namespace Swift {
AuthChallengeSerializer::AuthChallengeSerializer() {
}
-String AuthChallengeSerializer::serialize(boost::shared_ptr<Element> element) const {
+std::string AuthChallengeSerializer::serialize(boost::shared_ptr<Element> element) const {
boost::shared_ptr<AuthChallenge> authChallenge(boost::dynamic_pointer_cast<AuthChallenge>(element));
- String value;
+ std::string value;
boost::optional<ByteArray> message = authChallenge->getValue();
if (message) {
if ((*message).isEmpty()) {
diff --git a/Swiften/Serializer/AuthChallengeSerializer.h b/Swiften/Serializer/AuthChallengeSerializer.h
index 336a88c..a62efb3 100644
--- a/Swiften/Serializer/AuthChallengeSerializer.h
+++ b/Swiften/Serializer/AuthChallengeSerializer.h
@@ -16,6 +16,6 @@ namespace Swift {
public:
AuthChallengeSerializer();
- virtual String serialize(boost::shared_ptr<Element> element) const;
+ virtual std::string serialize(boost::shared_ptr<Element> element) const;
};
}
diff --git a/Swiften/Serializer/AuthFailureSerializer.h b/Swiften/Serializer/AuthFailureSerializer.h
index 7869b1f..477d98c 100644
--- a/Swiften/Serializer/AuthFailureSerializer.h
+++ b/Swiften/Serializer/AuthFailureSerializer.h
@@ -19,7 +19,7 @@ namespace Swift {
AuthFailureSerializer() : GenericElementSerializer<AuthFailure>() {
}
- virtual String serialize(boost::shared_ptr<Element>) const {
+ virtual std::string serialize(boost::shared_ptr<Element>) const {
return XMLElement("failure", "urn:ietf:params:xml:ns:xmpp-sasl").serialize();
}
};
diff --git a/Swiften/Serializer/AuthRequestSerializer.cpp b/Swiften/Serializer/AuthRequestSerializer.cpp
index 45b6503..0bee302 100644
--- a/Swiften/Serializer/AuthRequestSerializer.cpp
+++ b/Swiften/Serializer/AuthRequestSerializer.cpp
@@ -14,9 +14,9 @@ namespace Swift {
AuthRequestSerializer::AuthRequestSerializer() {
}
-String AuthRequestSerializer::serialize(boost::shared_ptr<Element> element) const {
+std::string AuthRequestSerializer::serialize(boost::shared_ptr<Element> element) const {
boost::shared_ptr<AuthRequest> authRequest(boost::dynamic_pointer_cast<AuthRequest>(element));
- String value;
+ std::string value;
boost::optional<ByteArray> message = authRequest->getMessage();
if (message) {
if ((*message).isEmpty()) {
diff --git a/Swiften/Serializer/AuthRequestSerializer.h b/Swiften/Serializer/AuthRequestSerializer.h
index 2680d45..18ef5dd 100644
--- a/Swiften/Serializer/AuthRequestSerializer.h
+++ b/Swiften/Serializer/AuthRequestSerializer.h
@@ -17,7 +17,7 @@ namespace Swift {
public:
AuthRequestSerializer();
- virtual String serialize(boost::shared_ptr<Element> element) const;
+ virtual std::string serialize(boost::shared_ptr<Element> element) const;
};
}
diff --git a/Swiften/Serializer/AuthResponseSerializer.cpp b/Swiften/Serializer/AuthResponseSerializer.cpp
index d2d5616..a93b4dd 100644
--- a/Swiften/Serializer/AuthResponseSerializer.cpp
+++ b/Swiften/Serializer/AuthResponseSerializer.cpp
@@ -14,9 +14,9 @@ namespace Swift {
AuthResponseSerializer::AuthResponseSerializer() {
}
-String AuthResponseSerializer::serialize(boost::shared_ptr<Element> element) const {
+std::string AuthResponseSerializer::serialize(boost::shared_ptr<Element> element) const {
boost::shared_ptr<AuthResponse> authResponse(boost::dynamic_pointer_cast<AuthResponse>(element));
- String value;
+ std::string value;
boost::optional<ByteArray> message = authResponse->getValue();
if (message) {
if ((*message).isEmpty()) {
diff --git a/Swiften/Serializer/AuthResponseSerializer.h b/Swiften/Serializer/AuthResponseSerializer.h
index b2f4739..cee8ff3 100644
--- a/Swiften/Serializer/AuthResponseSerializer.h
+++ b/Swiften/Serializer/AuthResponseSerializer.h
@@ -16,6 +16,6 @@ namespace Swift {
public:
AuthResponseSerializer();
- virtual String serialize(boost::shared_ptr<Element> element) const;
+ virtual std::string serialize(boost::shared_ptr<Element> element) const;
};
}
diff --git a/Swiften/Serializer/AuthSuccessSerializer.cpp b/Swiften/Serializer/AuthSuccessSerializer.cpp
index 6e9103b..443c740 100644
--- a/Swiften/Serializer/AuthSuccessSerializer.cpp
+++ b/Swiften/Serializer/AuthSuccessSerializer.cpp
@@ -14,9 +14,9 @@ namespace Swift {
AuthSuccessSerializer::AuthSuccessSerializer() {
}
-String AuthSuccessSerializer::serialize(boost::shared_ptr<Element> element) const {
+std::string AuthSuccessSerializer::serialize(boost::shared_ptr<Element> element) const {
boost::shared_ptr<AuthSuccess> authSuccess(boost::dynamic_pointer_cast<AuthSuccess>(element));
- String value;
+ std::string value;
boost::optional<ByteArray> message = authSuccess->getValue();
if (message) {
if ((*message).isEmpty()) {
diff --git a/Swiften/Serializer/AuthSuccessSerializer.h b/Swiften/Serializer/AuthSuccessSerializer.h
index 81b0e36..eb3279c 100644
--- a/Swiften/Serializer/AuthSuccessSerializer.h
+++ b/Swiften/Serializer/AuthSuccessSerializer.h
@@ -16,6 +16,6 @@ namespace Swift {
public:
AuthSuccessSerializer();
- virtual String serialize(boost::shared_ptr<Element> element) const;
+ virtual std::string serialize(boost::shared_ptr<Element> element) const;
};
}
diff --git a/Swiften/Serializer/ComponentHandshakeSerializer.cpp b/Swiften/Serializer/ComponentHandshakeSerializer.cpp
index 011d59e..cf44ea4 100644
--- a/Swiften/Serializer/ComponentHandshakeSerializer.cpp
+++ b/Swiften/Serializer/ComponentHandshakeSerializer.cpp
@@ -13,7 +13,7 @@ namespace Swift {
ComponentHandshakeSerializer::ComponentHandshakeSerializer() {
}
-String ComponentHandshakeSerializer::serialize(boost::shared_ptr<Element> element) const {
+std::string ComponentHandshakeSerializer::serialize(boost::shared_ptr<Element> element) const {
boost::shared_ptr<ComponentHandshake> handshake(boost::dynamic_pointer_cast<ComponentHandshake>(element));
return "<handshake>" + handshake->getData() + "</handshake>";
}
diff --git a/Swiften/Serializer/ComponentHandshakeSerializer.h b/Swiften/Serializer/ComponentHandshakeSerializer.h
index 5423f08..7681e56 100644
--- a/Swiften/Serializer/ComponentHandshakeSerializer.h
+++ b/Swiften/Serializer/ComponentHandshakeSerializer.h
@@ -16,6 +16,6 @@ namespace Swift {
public:
ComponentHandshakeSerializer();
- virtual String serialize(boost::shared_ptr<Element> element) const;
+ virtual std::string serialize(boost::shared_ptr<Element> element) const;
};
}
diff --git a/Swiften/Serializer/CompressFailureSerializer.h b/Swiften/Serializer/CompressFailureSerializer.h
index 608dadb..02a4b46 100644
--- a/Swiften/Serializer/CompressFailureSerializer.h
+++ b/Swiften/Serializer/CompressFailureSerializer.h
@@ -19,7 +19,7 @@ namespace Swift {
CompressFailureSerializer() : GenericElementSerializer<CompressFailure>() {
}
- virtual String serialize(boost::shared_ptr<Element>) const {
+ virtual std::string serialize(boost::shared_ptr<Element>) const {
return XMLElement("failure", "http://jabber.org/protocol/compress").serialize();
}
};
diff --git a/Swiften/Serializer/CompressRequestSerializer.cpp b/Swiften/Serializer/CompressRequestSerializer.cpp
index 4959665..7733169 100644
--- a/Swiften/Serializer/CompressRequestSerializer.cpp
+++ b/Swiften/Serializer/CompressRequestSerializer.cpp
@@ -13,7 +13,7 @@ namespace Swift {
CompressRequestSerializer::CompressRequestSerializer() {
}
-String CompressRequestSerializer::serialize(boost::shared_ptr<Element> element) const {
+std::string CompressRequestSerializer::serialize(boost::shared_ptr<Element> element) const {
boost::shared_ptr<CompressRequest> compressRequest(boost::dynamic_pointer_cast<CompressRequest>(element));
return "<compress xmlns='http://jabber.org/protocol/compress'><method>" + compressRequest->getMethod() + "</method></compress>";
}
diff --git a/Swiften/Serializer/CompressRequestSerializer.h b/Swiften/Serializer/CompressRequestSerializer.h
index 49d6c97..0a14fb1 100644
--- a/Swiften/Serializer/CompressRequestSerializer.h
+++ b/Swiften/Serializer/CompressRequestSerializer.h
@@ -16,7 +16,7 @@ namespace Swift {
public:
CompressRequestSerializer();
- virtual String serialize(boost::shared_ptr<Element> element) const;
+ virtual std::string serialize(boost::shared_ptr<Element> element) const;
virtual bool canSerialize(boost::shared_ptr<Element> element) const;
};
}
diff --git a/Swiften/Serializer/ElementSerializer.h b/Swiften/Serializer/ElementSerializer.h
index 48d73ee..3abdf08 100644
--- a/Swiften/Serializer/ElementSerializer.h
+++ b/Swiften/Serializer/ElementSerializer.h
@@ -9,7 +9,7 @@
#include <boost/shared_ptr.hpp>
-#include "Swiften/Base/String.h"
+#include <string>
#include "Swiften/Elements/Element.h"
namespace Swift {
@@ -17,7 +17,7 @@ namespace Swift {
public:
virtual ~ElementSerializer();
- virtual String serialize(boost::shared_ptr<Element> element) const = 0;
+ virtual std::string serialize(boost::shared_ptr<Element> element) const = 0;
virtual bool canSerialize(boost::shared_ptr<Element> element) const = 0;
};
}
diff --git a/Swiften/Serializer/EnableStreamManagementSerializer.h b/Swiften/Serializer/EnableStreamManagementSerializer.h
index c5a5011..e224a9c 100644
--- a/Swiften/Serializer/EnableStreamManagementSerializer.h
+++ b/Swiften/Serializer/EnableStreamManagementSerializer.h
@@ -18,7 +18,7 @@ namespace Swift {
EnableStreamManagementSerializer() : GenericElementSerializer<EnableStreamManagement>() {
}
- virtual String serialize(boost::shared_ptr<Element>) const {
+ virtual std::string serialize(boost::shared_ptr<Element>) const {
return XMLElement("enable", "urn:xmpp:sm:2").serialize();
}
};
diff --git a/Swiften/Serializer/GenericElementSerializer.h b/Swiften/Serializer/GenericElementSerializer.h
index 0329411..903c205 100644
--- a/Swiften/Serializer/GenericElementSerializer.h
+++ b/Swiften/Serializer/GenericElementSerializer.h
@@ -14,7 +14,7 @@ namespace Swift {
template<typename T>
class GenericElementSerializer : public ElementSerializer {
public:
- virtual String serialize(boost::shared_ptr<Element> element) const = 0;
+ virtual std::string serialize(boost::shared_ptr<Element> element) const = 0;
virtual bool canSerialize(boost::shared_ptr<Element> element) const {
return boost::dynamic_pointer_cast<T>(element);
diff --git a/Swiften/Serializer/GenericPayloadSerializer.h b/Swiften/Serializer/GenericPayloadSerializer.h
index 13603e5..b501613 100644
--- a/Swiften/Serializer/GenericPayloadSerializer.h
+++ b/Swiften/Serializer/GenericPayloadSerializer.h
@@ -14,7 +14,7 @@ namespace Swift {
template<typename PAYLOAD_TYPE>
class GenericPayloadSerializer : public PayloadSerializer {
public:
- virtual String serialize(boost::shared_ptr<Payload> element) const {
+ virtual std::string serialize(boost::shared_ptr<Payload> element) const {
return serializePayload(boost::dynamic_pointer_cast<PAYLOAD_TYPE>(element));
}
@@ -22,6 +22,6 @@ namespace Swift {
return boost::dynamic_pointer_cast<PAYLOAD_TYPE>(element);
}
- virtual String serializePayload(boost::shared_ptr<PAYLOAD_TYPE>) const = 0;
+ virtual std::string serializePayload(boost::shared_ptr<PAYLOAD_TYPE>) const = 0;
};
}
diff --git a/Swiften/Serializer/GenericStanzaSerializer.h b/Swiften/Serializer/GenericStanzaSerializer.h
index 557fb37..2f0fccf 100644
--- a/Swiften/Serializer/GenericStanzaSerializer.h
+++ b/Swiften/Serializer/GenericStanzaSerializer.h
@@ -13,7 +13,7 @@ namespace Swift {
template<typename STANZA_TYPE>
class GenericStanzaSerializer : public StanzaSerializer {
public:
- GenericStanzaSerializer(const String& tag, PayloadSerializerCollection* payloadSerializers) : StanzaSerializer(tag, payloadSerializers) {}
+ GenericStanzaSerializer(const std::string& tag, PayloadSerializerCollection* payloadSerializers) : StanzaSerializer(tag, payloadSerializers) {}
virtual bool canSerialize(boost::shared_ptr<Element> element) const {
return dynamic_cast<STANZA_TYPE*>(element.get()) != 0;
diff --git a/Swiften/Serializer/PayloadSerializer.h b/Swiften/Serializer/PayloadSerializer.h
index dbb984d..34e6679 100644
--- a/Swiften/Serializer/PayloadSerializer.h
+++ b/Swiften/Serializer/PayloadSerializer.h
@@ -9,7 +9,7 @@
#include <boost/shared_ptr.hpp>
-#include "Swiften/Base/String.h"
+#include <string>
#include "Swiften/Elements/Payload.h"
namespace Swift {
@@ -18,7 +18,7 @@ namespace Swift {
virtual ~PayloadSerializer();
virtual bool canSerialize(boost::shared_ptr<Payload>) const = 0;
- virtual String serialize(boost::shared_ptr<Payload>) const = 0;
+ virtual std::string serialize(boost::shared_ptr<Payload>) const = 0;
};
}
diff --git a/Swiften/Serializer/PayloadSerializerCollection.h b/Swiften/Serializer/PayloadSerializerCollection.h
index fdb8657..1b3cbc5 100644
--- a/Swiften/Serializer/PayloadSerializerCollection.h
+++ b/Swiften/Serializer/PayloadSerializerCollection.h
@@ -13,7 +13,7 @@
namespace Swift {
class PayloadSerializer;
- class String;
+
class PayloadSerializerCollection {
public:
diff --git a/Swiften/Serializer/PayloadSerializers/BodySerializer.h b/Swiften/Serializer/PayloadSerializers/BodySerializer.h
index c73f0c4..6fc6e6d 100644
--- a/Swiften/Serializer/PayloadSerializers/BodySerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/BodySerializer.h
@@ -16,7 +16,7 @@ namespace Swift {
public:
BodySerializer() : GenericPayloadSerializer<Body>() {}
- virtual String serializePayload(boost::shared_ptr<Body> body) const {
+ virtual std::string serializePayload(boost::shared_ptr<Body> body) const {
XMLTextNode textNode(body->getText());
return "<body>" + textNode.serialize() + "</body>";
}
diff --git a/Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.cpp b/Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.cpp
index 9acabee..f9b89f3 100644
--- a/Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.cpp
@@ -19,7 +19,7 @@ namespace Swift {
BytestreamsSerializer::BytestreamsSerializer() {
}
-String BytestreamsSerializer::serializePayload(boost::shared_ptr<Bytestreams> bytestreams) const {
+std::string BytestreamsSerializer::serializePayload(boost::shared_ptr<Bytestreams> bytestreams) const {
XMLElement queryElement("query", "http://jabber.org/protocol/bytestreams");
queryElement.setAttribute("sid", bytestreams->getStreamID());
foreach(const Bytestreams::StreamHost& streamHost, bytestreams->getStreamHosts()) {
diff --git a/Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.h b/Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.h
index 50d58c2..d9b14db 100644
--- a/Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.h
@@ -16,6 +16,6 @@ namespace Swift {
public:
BytestreamsSerializer();
- virtual String serializePayload(boost::shared_ptr<Bytestreams>) const;
+ virtual std::string serializePayload(boost::shared_ptr<Bytestreams>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.cpp b/Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.cpp
index c7b17bd..ced0d62 100644
--- a/Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.cpp
@@ -15,7 +15,7 @@ namespace Swift {
CapsInfoSerializer::CapsInfoSerializer() : GenericPayloadSerializer<CapsInfo>() {
}
-String CapsInfoSerializer::serializePayload(boost::shared_ptr<CapsInfo> capsInfo) const {
+std::string CapsInfoSerializer::serializePayload(boost::shared_ptr<CapsInfo> capsInfo) const {
XMLElement capsElement("c", "http://jabber.org/protocol/caps");
capsElement.setAttribute("node", capsInfo->getNode());
capsElement.setAttribute("hash", capsInfo->getHash());
diff --git a/Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.h b/Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.h
index a94916b..de0a871 100644
--- a/Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.h
@@ -15,7 +15,7 @@ namespace Swift {
public:
CapsInfoSerializer();
- virtual String serializePayload(boost::shared_ptr<CapsInfo>) const;
+ virtual std::string serializePayload(boost::shared_ptr<CapsInfo>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/ChatStateSerializer.cpp b/Swiften/Serializer/PayloadSerializers/ChatStateSerializer.cpp
index 9f0fe0d..3e877eb 100644
--- a/Swiften/Serializer/PayloadSerializers/ChatStateSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/ChatStateSerializer.cpp
@@ -11,8 +11,8 @@ namespace Swift {
ChatStateSerializer::ChatStateSerializer() : GenericPayloadSerializer<ChatState>() {
}
-String ChatStateSerializer::serializePayload(boost::shared_ptr<ChatState> chatState) const {
- String result("<");
+std::string ChatStateSerializer::serializePayload(boost::shared_ptr<ChatState> chatState) const {
+ std::string result("<");
switch (chatState->getChatState()) {
case ChatState::Active: result += "active"; break;
case ChatState::Composing: result += "composing"; break;
diff --git a/Swiften/Serializer/PayloadSerializers/ChatStateSerializer.h b/Swiften/Serializer/PayloadSerializers/ChatStateSerializer.h
index 724f4a1..a786901 100644
--- a/Swiften/Serializer/PayloadSerializers/ChatStateSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/ChatStateSerializer.h
@@ -14,6 +14,6 @@ namespace Swift {
public:
ChatStateSerializer();
- virtual String serializePayload(boost::shared_ptr<ChatState> error) const;
+ virtual std::string serializePayload(boost::shared_ptr<ChatState> error) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/CommandSerializer.cpp b/Swiften/Serializer/PayloadSerializers/CommandSerializer.cpp
index b29a634..0fa45ce 100644
--- a/Swiften/Serializer/PayloadSerializers/CommandSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/CommandSerializer.cpp
@@ -20,34 +20,34 @@ namespace Swift {
CommandSerializer::CommandSerializer() {
}
-String CommandSerializer::serializePayload(boost::shared_ptr<Command> command) const {
+std::string CommandSerializer::serializePayload(boost::shared_ptr<Command> command) const {
XMLElement commandElement("command", "http://jabber.org/protocol/comands");
commandElement.setAttribute("node", command->getNode());
- if (!command->getSessionID().isEmpty()) {
+ if (!command->getSessionID().empty()) {
commandElement.setAttribute("sessionid", command->getSessionID());
}
- String action = actionToString(command->getAction());
- if (!action.isEmpty()) {
+ std::string action = actionToString(command->getAction());
+ if (!action.empty()) {
commandElement.setAttribute("action", action);
}
- String status;
+ std::string status;
switch (command->getStatus()) {
case Command::Executing: status = "executing";break;
case Command::Completed: status = "completed";break;
case Command::Canceled: status = "canceled";break;
case Command::NoStatus: break;
}
- if (!status.isEmpty()) {
+ if (!status.empty()) {
commandElement.setAttribute("status", status);
}
if (command->getAvailableActions().size() > 0) {
- String actions = "<actions";
- String executeAction = actionToString(command->getExecuteAction());
- if (!executeAction.isEmpty()) {
+ std::string actions = "<actions";
+ std::string executeAction = actionToString(command->getExecuteAction());
+ if (!executeAction.empty()) {
actions += " execute='" + executeAction + "'";
}
actions += ">";
@@ -60,13 +60,13 @@ String CommandSerializer::serializePayload(boost::shared_ptr<Command> command) c
foreach (Command::Note note, command->getNotes()) {
boost::shared_ptr<XMLElement> noteElement(new XMLElement("note"));
- String type;
+ std::string type;
switch (note.type) {
case Command::Note::Info: type = "info"; break;
case Command::Note::Warn: type = "warn"; break;
case Command::Note::Error: type = "error"; break;
}
- if (!type.isEmpty()) {
+ if (!type.empty()) {
noteElement->setAttribute("type", type);
}
noteElement->addNode(boost::shared_ptr<XMLTextNode>(new XMLTextNode(note.note)));
@@ -80,8 +80,8 @@ String CommandSerializer::serializePayload(boost::shared_ptr<Command> command) c
return commandElement.serialize();
}
-String CommandSerializer::actionToString(Command::Action action) const {
- String string;
+std::string CommandSerializer::actionToString(Command::Action action) const {
+ std::string string;
switch (action) {
case Command::Cancel: string = "cancel"; break;
case Command::Execute: string = "execute"; break;
diff --git a/Swiften/Serializer/PayloadSerializers/CommandSerializer.h b/Swiften/Serializer/PayloadSerializers/CommandSerializer.h
index 4b71aea..b1db825 100644
--- a/Swiften/Serializer/PayloadSerializers/CommandSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/CommandSerializer.h
@@ -16,9 +16,9 @@ namespace Swift {
public:
CommandSerializer();
- virtual String serializePayload(boost::shared_ptr<Command>) const;
+ virtual std::string serializePayload(boost::shared_ptr<Command>) const;
private:
- String actionToString(Command::Action action) const;
+ std::string actionToString(Command::Action action) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp b/Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp
index a54cf9e..4922042 100644
--- a/Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp
@@ -8,6 +8,7 @@
#include <boost/shared_ptr.hpp>
+#include <Swiften/Base/String.h>
#include "Swiften/Serializer/XML/XMLElement.h"
namespace Swift {
@@ -15,19 +16,19 @@ namespace Swift {
DelaySerializer::DelaySerializer() : GenericPayloadSerializer<Delay>() {
}
-String DelaySerializer::serializePayload(boost::shared_ptr<Delay> delay) const {
+std::string DelaySerializer::serializePayload(boost::shared_ptr<Delay> delay) const {
XMLElement delayElement("delay", "urn:xmpp:delay");
if (delay->getFrom()) {
delayElement.setAttribute("from", delay->getFrom()->toString());
}
- String stampString = boostPTimeToXEP0082(delay->getStamp());
+ std::string stampString = boostPTimeToXEP0082(delay->getStamp());
delayElement.setAttribute("stamp", stampString);
return delayElement.serialize();
}
-String DelaySerializer::boostPTimeToXEP0082(const boost::posix_time::ptime& time) {
- String stampString = String(boost::posix_time::to_iso_extended_string(time));
- stampString.replaceAll(',', ".");
+std::string DelaySerializer::boostPTimeToXEP0082(const boost::posix_time::ptime& time) {
+ std::string stampString = std::string(boost::posix_time::to_iso_extended_string(time));
+ String::replaceAll(stampString, ',', ".");
stampString += "Z";
return stampString;
}
diff --git a/Swiften/Serializer/PayloadSerializers/DelaySerializer.h b/Swiften/Serializer/PayloadSerializers/DelaySerializer.h
index eb33c9f..c37dc02 100644
--- a/Swiften/Serializer/PayloadSerializers/DelaySerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/DelaySerializer.h
@@ -14,8 +14,8 @@ namespace Swift {
public:
DelaySerializer();
- virtual String serializePayload(boost::shared_ptr<Delay>) const;
- static String boostPTimeToXEP0082(const boost::posix_time::ptime& time);
+ virtual std::string serializePayload(boost::shared_ptr<Delay>) const;
+ static std::string boostPTimeToXEP0082(const boost::posix_time::ptime& time);
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.cpp b/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.cpp
index f5923dc..65b0a38 100644
--- a/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.cpp
@@ -18,14 +18,14 @@ namespace Swift {
DiscoInfoSerializer::DiscoInfoSerializer() : GenericPayloadSerializer<DiscoInfo>() {
}
-String DiscoInfoSerializer::serializePayload(boost::shared_ptr<DiscoInfo> discoInfo) const {
+std::string DiscoInfoSerializer::serializePayload(boost::shared_ptr<DiscoInfo> discoInfo) const {
XMLElement queryElement("query", "http://jabber.org/protocol/disco#info");
- if (!discoInfo->getNode().isEmpty()) {
+ if (!discoInfo->getNode().empty()) {
queryElement.setAttribute("node", discoInfo->getNode());
}
foreach(const DiscoInfo::Identity& identity, discoInfo->getIdentities()) {
boost::shared_ptr<XMLElement> identityElement(new XMLElement("identity"));
- if (!identity.getLanguage().isEmpty()) {
+ if (!identity.getLanguage().empty()) {
identityElement->setAttribute("xml:lang", identity.getLanguage());
}
identityElement->setAttribute("category", identity.getCategory());
@@ -33,7 +33,7 @@ String DiscoInfoSerializer::serializePayload(boost::shared_ptr<DiscoInfo> discoI
identityElement->setAttribute("type", identity.getType());
queryElement.addNode(identityElement);
}
- foreach(const String& feature, discoInfo->getFeatures()) {
+ foreach(const std::string& feature, discoInfo->getFeatures()) {
boost::shared_ptr<XMLElement> featureElement(new XMLElement("feature"));
featureElement->setAttribute("var", feature);
queryElement.addNode(featureElement);
diff --git a/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.h b/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.h
index 63047d1..46e7ce2 100644
--- a/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.h
@@ -15,7 +15,7 @@ namespace Swift {
public:
DiscoInfoSerializer();
- virtual String serializePayload(boost::shared_ptr<DiscoInfo>) const;
+ virtual std::string serializePayload(boost::shared_ptr<DiscoInfo>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/DiscoItemsSerializer.cpp b/Swiften/Serializer/PayloadSerializers/DiscoItemsSerializer.cpp
index 056c515..cb1b7c1 100644
--- a/Swiften/Serializer/PayloadSerializers/DiscoItemsSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/DiscoItemsSerializer.cpp
@@ -16,16 +16,16 @@ namespace Swift {
DiscoItemsSerializer::DiscoItemsSerializer() : GenericPayloadSerializer<DiscoItems>() {
}
-String DiscoItemsSerializer::serializePayload(boost::shared_ptr<DiscoItems> discoItems) const {
+std::string DiscoItemsSerializer::serializePayload(boost::shared_ptr<DiscoItems> discoItems) const {
XMLElement queryElement("query", "http://jabber.org/protocol/disco#items");
- if (!discoItems->getNode().isEmpty()) {
+ if (!discoItems->getNode().empty()) {
queryElement.setAttribute("node", discoItems->getNode());
}
foreach(const DiscoItems::Item& item, discoItems->getItems()) {
boost::shared_ptr<XMLElement> itemElement(new XMLElement("item"));
itemElement->setAttribute("name", item.getName());
itemElement->setAttribute("jid", item.getJID());
- if (!item.getNode().isEmpty()) {
+ if (!item.getNode().empty()) {
itemElement->setAttribute("node", item.getNode());
}
queryElement.addNode(itemElement);
diff --git a/Swiften/Serializer/PayloadSerializers/DiscoItemsSerializer.h b/Swiften/Serializer/PayloadSerializers/DiscoItemsSerializer.h
index 8116e9b..3b00a17 100644
--- a/Swiften/Serializer/PayloadSerializers/DiscoItemsSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/DiscoItemsSerializer.h
@@ -14,7 +14,7 @@ namespace Swift {
public:
DiscoItemsSerializer();
- virtual String serializePayload(boost::shared_ptr<DiscoItems>) const;
+ virtual std::string serializePayload(boost::shared_ptr<DiscoItems>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/ErrorSerializer.cpp b/Swiften/Serializer/PayloadSerializers/ErrorSerializer.cpp
index d041f6e..15d13d7 100644
--- a/Swiften/Serializer/PayloadSerializers/ErrorSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/ErrorSerializer.cpp
@@ -12,8 +12,8 @@ namespace Swift {
ErrorSerializer::ErrorSerializer() : GenericPayloadSerializer<ErrorPayload>() {
}
-String ErrorSerializer::serializePayload(boost::shared_ptr<ErrorPayload> error) const {
- String result("<error type=\"");
+std::string ErrorSerializer::serializePayload(boost::shared_ptr<ErrorPayload> error) const {
+ std::string result("<error type=\"");
switch (error->getType()) {
case ErrorPayload::Continue: result += "continue"; break;
case ErrorPayload::Modify: result += "modify"; break;
@@ -23,7 +23,7 @@ String ErrorSerializer::serializePayload(boost::shared_ptr<ErrorPayload> error)
}
result += "\">";
- String conditionElement;
+ std::string conditionElement;
switch (error->getCondition()) {
case ErrorPayload::BadRequest: conditionElement = "bad-request"; break;
case ErrorPayload::Conflict: conditionElement = "conflict"; break;
@@ -50,7 +50,7 @@ String ErrorSerializer::serializePayload(boost::shared_ptr<ErrorPayload> error)
}
result += "<" + conditionElement + " xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\"/>";
- if (!error->getText().isEmpty()) {
+ if (!error->getText().empty()) {
XMLTextNode textNode(error->getText());
result += "<text xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\">" + textNode.serialize() + "</text>";
}
diff --git a/Swiften/Serializer/PayloadSerializers/ErrorSerializer.h b/Swiften/Serializer/PayloadSerializers/ErrorSerializer.h
index ee32279..7fc4dad 100644
--- a/Swiften/Serializer/PayloadSerializers/ErrorSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/ErrorSerializer.h
@@ -15,7 +15,7 @@ namespace Swift {
public:
ErrorSerializer();
- virtual String serializePayload(boost::shared_ptr<ErrorPayload> error) const;
+ virtual std::string serializePayload(boost::shared_ptr<ErrorPayload> error) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/FormSerializer.cpp b/Swiften/Serializer/PayloadSerializers/FormSerializer.cpp
index 77c2fd4..53b4241 100644
--- a/Swiften/Serializer/PayloadSerializers/FormSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/FormSerializer.cpp
@@ -8,9 +8,10 @@
#include <boost/shared_ptr.hpp>
#include <iostream>
+#include <string>
-#include "Swiften/Base/foreach.h"
#include "Swiften/Base/String.h"
+#include "Swiften/Base/foreach.h"
#include "Swiften/Serializer/XML/XMLTextNode.h"
#include "Swiften/Serializer/XML/XMLRawTextNode.h"
@@ -18,8 +19,8 @@ using namespace Swift;
namespace {
template<typename T> void serializeValueAsString(boost::shared_ptr<FormField> field, boost::shared_ptr<XMLElement> parent) {
- String value = boost::dynamic_pointer_cast<T>(field)->getValue();
- if (!value.isEmpty()) {
+ std::string value = boost::dynamic_pointer_cast<T>(field)->getValue();
+ if (!value.empty()) {
boost::shared_ptr<XMLElement> valueElement(new XMLElement("value"));
valueElement->addNode(XMLTextNode::create(value));
parent->addNode(valueElement);
@@ -33,9 +34,9 @@ namespace Swift {
FormSerializer::FormSerializer() : GenericPayloadSerializer<Form>() {
}
-String FormSerializer::serializePayload(boost::shared_ptr<Form> form) const {
+std::string FormSerializer::serializePayload(boost::shared_ptr<Form> form) const {
boost::shared_ptr<XMLElement> formElement(new XMLElement("x", "jabber:x:data"));
- String type;
+ std::string type;
switch (form->getType()) {
case Form::FormType: type = "form"; break;
case Form::SubmitType: type = "submit"; break;
@@ -43,10 +44,10 @@ String FormSerializer::serializePayload(boost::shared_ptr<Form> form) const {
case Form::ResultType: type = "result"; break;
}
formElement->setAttribute("type", type);
- if (!form->getTitle().isEmpty()) {
+ if (!form->getTitle().empty()) {
multiLineify(form->getTitle(), "title", formElement);
}
- if (!form->getInstructions().isEmpty()) {
+ if (!form->getInstructions().empty()) {
multiLineify(form->getInstructions(), "instructions", formElement);
}
foreach(boost::shared_ptr<FormField> field, form->getFields()) {
@@ -57,23 +58,23 @@ String FormSerializer::serializePayload(boost::shared_ptr<Form> form) const {
boost::shared_ptr<XMLElement> FormSerializer::fieldToXML(boost::shared_ptr<FormField> field) const {
boost::shared_ptr<XMLElement> fieldElement(new XMLElement("field"));
- if (!field->getName().isEmpty()) {
+ if (!field->getName().empty()) {
fieldElement->setAttribute("var", field->getName());
}
- if (!field->getLabel().isEmpty()) {
+ if (!field->getLabel().empty()) {
fieldElement->setAttribute("label", field->getLabel());
}
if (field->getRequired()) {
fieldElement->addNode(boost::shared_ptr<XMLElement>(new XMLElement("required")));
}
- if (!field->getDescription().isEmpty()) {
+ if (!field->getDescription().empty()) {
boost::shared_ptr<XMLElement> descriptionElement(new XMLElement("desc"));
descriptionElement->addNode(boost::shared_ptr<XMLTextNode>(new XMLTextNode(field->getDescription())));
fieldElement->addNode(descriptionElement);
}
// Set the value and type
- String fieldType;
+ std::string fieldType;
if (boost::dynamic_pointer_cast<BooleanFormField>(field)) {
fieldType = "boolean";
boost::shared_ptr<XMLElement> valueElement(new XMLElement("value"));
@@ -117,8 +118,8 @@ boost::shared_ptr<XMLElement> FormSerializer::fieldToXML(boost::shared_ptr<FormF
}
else if (boost::dynamic_pointer_cast<ListMultiFormField>(field)) {
fieldType = "list-multi";
- std::vector<String> lines = boost::dynamic_pointer_cast<ListMultiFormField>(field)->getValue();
- foreach(const String& line, lines) {
+ std::vector<std::string> lines = boost::dynamic_pointer_cast<ListMultiFormField>(field)->getValue();
+ foreach(const std::string& line, lines) {
boost::shared_ptr<XMLElement> valueElement(new XMLElement("value"));
valueElement->addNode(XMLTextNode::create(line));
fieldElement->addNode(valueElement);
@@ -129,8 +130,8 @@ boost::shared_ptr<XMLElement> FormSerializer::fieldToXML(boost::shared_ptr<FormF
multiLineify(boost::dynamic_pointer_cast<TextMultiFormField>(field)->getValue(), "value", fieldElement);
}
else if (boost::dynamic_pointer_cast<UntypedFormField>(field)) {
- std::vector<String> lines = boost::dynamic_pointer_cast<UntypedFormField>(field)->getValue();
- foreach(const String& line, lines) {
+ std::vector<std::string> lines = boost::dynamic_pointer_cast<UntypedFormField>(field)->getValue();
+ foreach(const std::string& line, lines) {
boost::shared_ptr<XMLElement> valueElement(new XMLElement("value"));
valueElement->addNode(XMLTextNode::create(line));
fieldElement->addNode(valueElement);
@@ -139,13 +140,13 @@ boost::shared_ptr<XMLElement> FormSerializer::fieldToXML(boost::shared_ptr<FormF
else {
assert(false);
}
- if (!fieldType.isEmpty()) {
+ if (!fieldType.empty()) {
fieldElement->setAttribute("type", fieldType);
}
foreach (const FormField::Option& option, field->getOptions()) {
boost::shared_ptr<XMLElement> optionElement(new XMLElement("option"));
- if (!option.label.isEmpty()) {
+ if (!option.label.empty()) {
optionElement->setAttribute("label", option.label);
}
@@ -159,11 +160,11 @@ boost::shared_ptr<XMLElement> FormSerializer::fieldToXML(boost::shared_ptr<FormF
return fieldElement;
}
-void FormSerializer::multiLineify(const String& text, const String& elementName, boost::shared_ptr<XMLElement> element) const {
- String unRdText(text);
- unRdText.removeAll('\r');
- std::vector<String> lines = unRdText.split('\n');
- foreach (String line, lines) {
+void FormSerializer::multiLineify(const std::string& text, const std::string& elementName, boost::shared_ptr<XMLElement> element) const {
+ std::string unRdText(text);
+ unRdText.erase(std::remove(unRdText.begin(), unRdText.end(), '\r'), unRdText.end());
+ std::vector<std::string> lines = String::split(unRdText, '\n');
+ foreach (std::string line, lines) {
boost::shared_ptr<XMLElement> lineElement(new XMLElement(elementName));
lineElement->addNode(boost::shared_ptr<XMLTextNode>(new XMLTextNode(line)));
element->addNode(lineElement);
diff --git a/Swiften/Serializer/PayloadSerializers/FormSerializer.h b/Swiften/Serializer/PayloadSerializers/FormSerializer.h
index 1cdc7f2..86c8dee 100644
--- a/Swiften/Serializer/PayloadSerializers/FormSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/FormSerializer.h
@@ -16,11 +16,11 @@ namespace Swift {
public:
FormSerializer();
- virtual String serializePayload(boost::shared_ptr<Form>) const;
+ virtual std::string serializePayload(boost::shared_ptr<Form>) const;
private:
boost::shared_ptr<XMLElement> fieldToXML(boost::shared_ptr<FormField> field) const;
- void multiLineify(const String& text, const String& elementName, boost::shared_ptr<XMLElement> parent) const;
+ void multiLineify(const std::string& text, const std::string& elementName, boost::shared_ptr<XMLElement> parent) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/IBBSerializer.cpp b/Swiften/Serializer/PayloadSerializers/IBBSerializer.cpp
index 5e52145..7ac4103 100644
--- a/Swiften/Serializer/PayloadSerializers/IBBSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/IBBSerializer.cpp
@@ -20,7 +20,7 @@ namespace Swift {
IBBSerializer::IBBSerializer() {
}
-String IBBSerializer::serializePayload(boost::shared_ptr<IBB> ibb) const {
+std::string IBBSerializer::serializePayload(boost::shared_ptr<IBB> ibb) const {
switch(ibb->getAction()) {
case IBB::Data: {
XMLElement ibbElement("data", "http://jabber.org/protocol/ibb");
diff --git a/Swiften/Serializer/PayloadSerializers/IBBSerializer.h b/Swiften/Serializer/PayloadSerializers/IBBSerializer.h
index 71b1c80..d750f6f 100644
--- a/Swiften/Serializer/PayloadSerializers/IBBSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/IBBSerializer.h
@@ -16,6 +16,6 @@ namespace Swift {
public:
IBBSerializer();
- virtual String serializePayload(boost::shared_ptr<IBB>) const;
+ virtual std::string serializePayload(boost::shared_ptr<IBB>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/InBandRegistrationPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/InBandRegistrationPayloadSerializer.cpp
index 5729df6..e4ae11f 100644
--- a/Swiften/Serializer/PayloadSerializers/InBandRegistrationPayloadSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/InBandRegistrationPayloadSerializer.cpp
@@ -18,7 +18,7 @@ namespace Swift {
InBandRegistrationPayloadSerializer::InBandRegistrationPayloadSerializer() {
}
-String InBandRegistrationPayloadSerializer::serializePayload(boost::shared_ptr<InBandRegistrationPayload> registration) const {
+std::string InBandRegistrationPayloadSerializer::serializePayload(boost::shared_ptr<InBandRegistrationPayload> registration) const {
XMLElement registerElement("query", "jabber:iq:register");
if (registration->isRegistered()) {
diff --git a/Swiften/Serializer/PayloadSerializers/InBandRegistrationPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/InBandRegistrationPayloadSerializer.h
index 168aa3a..45d49ea 100644
--- a/Swiften/Serializer/PayloadSerializers/InBandRegistrationPayloadSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/InBandRegistrationPayloadSerializer.h
@@ -17,6 +17,6 @@ namespace Swift {
public:
InBandRegistrationPayloadSerializer();
- virtual String serializePayload(boost::shared_ptr<InBandRegistrationPayload>) const;
+ virtual std::string serializePayload(boost::shared_ptr<InBandRegistrationPayload>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/MUCOwnerPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/MUCOwnerPayloadSerializer.cpp
index dbf79d4..db28514 100644
--- a/Swiften/Serializer/PayloadSerializers/MUCOwnerPayloadSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/MUCOwnerPayloadSerializer.cpp
@@ -15,7 +15,7 @@ namespace Swift {
MUCOwnerPayloadSerializer::MUCOwnerPayloadSerializer(PayloadSerializerCollection* serializers) : GenericPayloadSerializer<MUCOwnerPayload>(), serializers(serializers) {
}
-String MUCOwnerPayloadSerializer::serializePayload(boost::shared_ptr<MUCOwnerPayload> mucOwner) const {
+std::string MUCOwnerPayloadSerializer::serializePayload(boost::shared_ptr<MUCOwnerPayload> mucOwner) const {
XMLElement mucElement("query", "http://jabber.org/protocol/muc#owner");
boost::shared_ptr<Payload> payload = mucOwner->getPayload();
if (payload) {
diff --git a/Swiften/Serializer/PayloadSerializers/MUCOwnerPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/MUCOwnerPayloadSerializer.h
index 862cfce..4808744 100644
--- a/Swiften/Serializer/PayloadSerializers/MUCOwnerPayloadSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/MUCOwnerPayloadSerializer.h
@@ -14,7 +14,7 @@ namespace Swift {
class MUCOwnerPayloadSerializer : public GenericPayloadSerializer<MUCOwnerPayload> {
public:
MUCOwnerPayloadSerializer(PayloadSerializerCollection* serializers);
- virtual String serializePayload(boost::shared_ptr<MUCOwnerPayload> version) const;
+ virtual std::string serializePayload(boost::shared_ptr<MUCOwnerPayload> version) const;
private:
PayloadSerializerCollection* serializers;
};
diff --git a/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.cpp
index 087dece..d7e1613 100644
--- a/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.cpp
@@ -7,13 +7,14 @@
#include "Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.h"
#include "Swiften/Serializer/XML/XMLElement.h"
+#include <Swiften/Base/String.h>
namespace Swift {
MUCPayloadSerializer::MUCPayloadSerializer() : GenericPayloadSerializer<MUCPayload>() {
}
-String MUCPayloadSerializer::serializePayload(boost::shared_ptr<MUCPayload> muc) const {
+std::string MUCPayloadSerializer::serializePayload(boost::shared_ptr<MUCPayload> muc) const {
XMLElement mucElement("x", "http://jabber.org/protocol/muc");
boost::shared_ptr<XMLElement> historyElement(new XMLElement("history"));
bool history = false;
@@ -30,8 +31,8 @@ String MUCPayloadSerializer::serializePayload(boost::shared_ptr<MUCPayload> muc)
history = true;
}
if (muc->getSince() != boost::posix_time::not_a_date_time) {
- String sinceString = String(boost::posix_time::to_iso_extended_string(muc->getSince()));
- sinceString.replaceAll(',', ".");
+ std::string sinceString = std::string(boost::posix_time::to_iso_extended_string(muc->getSince()));
+ String::replaceAll(sinceString, ',', ".");
sinceString += "Z";
historyElement->setAttribute("since", sinceString);
history = true;
diff --git a/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.h
index cd7f107..7038e6e 100644
--- a/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.h
@@ -13,7 +13,7 @@ namespace Swift {
class MUCPayloadSerializer : public GenericPayloadSerializer<MUCPayload> {
public:
MUCPayloadSerializer();
- virtual String serializePayload(boost::shared_ptr<MUCPayload> version) const;
+ virtual std::string serializePayload(boost::shared_ptr<MUCPayload> version) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.cpp
index f4732ea..50746a9 100644
--- a/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.cpp
@@ -20,7 +20,7 @@ namespace Swift {
MUCUserPayloadSerializer::MUCUserPayloadSerializer() : GenericPayloadSerializer<MUCUserPayload>() {
}
-String MUCUserPayloadSerializer::serializePayload(boost::shared_ptr<MUCUserPayload> payload) const {
+std::string MUCUserPayloadSerializer::serializePayload(boost::shared_ptr<MUCUserPayload> payload) const {
XMLElement mucElement("x", "http://jabber.org/protocol/muc");
foreach (const MUCUserPayload::StatusCode statusCode, payload->getStatusCodes()) {
boost::shared_ptr<XMLElement> statusElement(new XMLElement("status"));
@@ -44,8 +44,8 @@ String MUCUserPayloadSerializer::serializePayload(boost::shared_ptr<MUCUserPaylo
return mucElement.serialize();
}
-String MUCUserPayloadSerializer::affiliationToString(MUCOccupant::Affiliation affiliation) const {
- String result;
+std::string MUCUserPayloadSerializer::affiliationToString(MUCOccupant::Affiliation affiliation) const {
+ std::string result;
switch (affiliation) {
case MUCOccupant::Owner: result = "owner"; break;
case MUCOccupant::Admin: result = "admin"; break;
@@ -57,8 +57,8 @@ String MUCUserPayloadSerializer::affiliationToString(MUCOccupant::Affiliation af
return result;
}
-String MUCUserPayloadSerializer::roleToString(MUCOccupant::Role role) const {
- String result;
+std::string MUCUserPayloadSerializer::roleToString(MUCOccupant::Role role) const {
+ std::string result;
switch (role) {
case MUCOccupant::Moderator: result = "moderator"; break;
case MUCOccupant::NoRole: result = "none"; break;
diff --git a/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.h
index bad21c9..54e6aff 100644
--- a/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.h
@@ -13,10 +13,10 @@ namespace Swift {
class MUCUserPayloadSerializer : public GenericPayloadSerializer<MUCUserPayload> {
public:
MUCUserPayloadSerializer();
- String affiliationToString(MUCOccupant::Affiliation affiliation) const;
- String roleToString(MUCOccupant::Role role) const;
+ std::string affiliationToString(MUCOccupant::Affiliation affiliation) const;
+ std::string roleToString(MUCOccupant::Role role) const;
- virtual String serializePayload(boost::shared_ptr<MUCUserPayload> version) const;
+ virtual std::string serializePayload(boost::shared_ptr<MUCUserPayload> version) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/NicknameSerializer.cpp b/Swiften/Serializer/PayloadSerializers/NicknameSerializer.cpp
index 55d5bb6..23d2c25 100644
--- a/Swiften/Serializer/PayloadSerializers/NicknameSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/NicknameSerializer.cpp
@@ -16,7 +16,7 @@ namespace Swift {
NicknameSerializer::NicknameSerializer() : GenericPayloadSerializer<Nickname>() {
}
-String NicknameSerializer::serializePayload(boost::shared_ptr<Nickname> nick) const {
+std::string NicknameSerializer::serializePayload(boost::shared_ptr<Nickname> nick) const {
XMLElement nickElement("nick", "http://jabber.org/protocol/nick");
nickElement.addNode(boost::shared_ptr<XMLTextNode>(new XMLTextNode(nick->getNickname())));
return nickElement.serialize();
diff --git a/Swiften/Serializer/PayloadSerializers/NicknameSerializer.h b/Swiften/Serializer/PayloadSerializers/NicknameSerializer.h
index e296ffd..e07767b 100644
--- a/Swiften/Serializer/PayloadSerializers/NicknameSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/NicknameSerializer.h
@@ -14,7 +14,7 @@ namespace Swift {
public:
NicknameSerializer();
- virtual String serializePayload(boost::shared_ptr<Nickname>) const;
+ virtual std::string serializePayload(boost::shared_ptr<Nickname>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/PrioritySerializer.h b/Swiften/Serializer/PayloadSerializers/PrioritySerializer.h
index a242215..cc96ce7 100644
--- a/Swiften/Serializer/PayloadSerializers/PrioritySerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PrioritySerializer.h
@@ -17,7 +17,7 @@ namespace Swift {
public:
PrioritySerializer() : GenericPayloadSerializer<Priority>() {}
- virtual String serializePayload(boost::shared_ptr<Priority> priority) const {
+ virtual std::string serializePayload(boost::shared_ptr<Priority> priority) const {
return "<priority>" + boost::lexical_cast<std::string>(priority->getPriority()) + "</priority>";
}
};
diff --git a/Swiften/Serializer/PayloadSerializers/PrivateStorageSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PrivateStorageSerializer.cpp
index 1964d96..6e1d74d 100644
--- a/Swiften/Serializer/PayloadSerializers/PrivateStorageSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PrivateStorageSerializer.cpp
@@ -19,7 +19,7 @@ namespace Swift {
PrivateStorageSerializer::PrivateStorageSerializer(PayloadSerializerCollection* serializers) : serializers(serializers) {
}
-String PrivateStorageSerializer::serializePayload(boost::shared_ptr<PrivateStorage> storage) const {
+std::string PrivateStorageSerializer::serializePayload(boost::shared_ptr<PrivateStorage> storage) const {
XMLElement storageElement("query", "jabber:iq:private");
boost::shared_ptr<Payload> payload = storage->getPayload();
if (payload) {
diff --git a/Swiften/Serializer/PayloadSerializers/PrivateStorageSerializer.h b/Swiften/Serializer/PayloadSerializers/PrivateStorageSerializer.h
index 03448be..7b46136 100644
--- a/Swiften/Serializer/PayloadSerializers/PrivateStorageSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PrivateStorageSerializer.h
@@ -16,7 +16,7 @@ namespace Swift {
public:
PrivateStorageSerializer(PayloadSerializerCollection* serializers);
- virtual String serializePayload(boost::shared_ptr<PrivateStorage>) const;
+ virtual std::string serializePayload(boost::shared_ptr<PrivateStorage>) const;
private:
PayloadSerializerCollection* serializers;
diff --git a/Swiften/Serializer/PayloadSerializers/RawXMLPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/RawXMLPayloadSerializer.h
index 725a5cd..6874569 100644
--- a/Swiften/Serializer/PayloadSerializers/RawXMLPayloadSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/RawXMLPayloadSerializer.h
@@ -14,7 +14,7 @@ namespace Swift {
public:
RawXMLPayloadSerializer() : GenericPayloadSerializer<RawXMLPayload>() {}
- virtual String serializePayload(boost::shared_ptr<RawXMLPayload> p) const {
+ virtual std::string serializePayload(boost::shared_ptr<RawXMLPayload> p) const {
return p->getRawXML();
}
};
diff --git a/Swiften/Serializer/PayloadSerializers/ResourceBindSerializer.cpp b/Swiften/Serializer/PayloadSerializers/ResourceBindSerializer.cpp
index cdc5764..cfb3a90 100644
--- a/Swiften/Serializer/PayloadSerializers/ResourceBindSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/ResourceBindSerializer.cpp
@@ -16,14 +16,14 @@ namespace Swift {
ResourceBindSerializer::ResourceBindSerializer() : GenericPayloadSerializer<ResourceBind>() {
}
-String ResourceBindSerializer::serializePayload(boost::shared_ptr<ResourceBind> resourceBind) const {
+std::string ResourceBindSerializer::serializePayload(boost::shared_ptr<ResourceBind> resourceBind) const {
XMLElement bindElement("bind", "urn:ietf:params:xml:ns:xmpp-bind");
if (resourceBind->getJID().isValid()) {
boost::shared_ptr<XMLElement> jidNode(new XMLElement("jid"));
jidNode->addNode(boost::shared_ptr<XMLTextNode>(new XMLTextNode(resourceBind->getJID().toString())));
bindElement.addNode(jidNode);
}
- else if (!resourceBind->getResource().isEmpty()) {
+ else if (!resourceBind->getResource().empty()) {
boost::shared_ptr<XMLElement> resourceNode(new XMLElement("resource"));
resourceNode->addNode(boost::shared_ptr<XMLTextNode>(new XMLTextNode(resourceBind->getResource())));
bindElement.addNode(resourceNode);
diff --git a/Swiften/Serializer/PayloadSerializers/ResourceBindSerializer.h b/Swiften/Serializer/PayloadSerializers/ResourceBindSerializer.h
index 7248863..d259555 100644
--- a/Swiften/Serializer/PayloadSerializers/ResourceBindSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/ResourceBindSerializer.h
@@ -15,7 +15,7 @@ namespace Swift {
public:
ResourceBindSerializer();
- virtual String serializePayload(boost::shared_ptr<ResourceBind>) const;
+ virtual std::string serializePayload(boost::shared_ptr<ResourceBind>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/RosterSerializer.cpp b/Swiften/Serializer/PayloadSerializers/RosterSerializer.cpp
index b56f404..40faf73 100644
--- a/Swiften/Serializer/PayloadSerializers/RosterSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/RosterSerializer.cpp
@@ -18,7 +18,7 @@ namespace Swift {
RosterSerializer::RosterSerializer() : GenericPayloadSerializer<RosterPayload>() {
}
-String RosterSerializer::serializePayload(boost::shared_ptr<RosterPayload> roster) const {
+std::string RosterSerializer::serializePayload(boost::shared_ptr<RosterPayload> roster) const {
XMLElement queryElement("query", "jabber:iq:roster");
foreach(const RosterItemPayload& item, roster->getItems()) {
boost::shared_ptr<XMLElement> itemElement(new XMLElement("item"));
@@ -37,13 +37,13 @@ String RosterSerializer::serializePayload(boost::shared_ptr<RosterPayload> roste
itemElement->setAttribute("ask", "subscribe");
}
- foreach(const String& group, item.getGroups()) {
+ foreach(const std::string& group, item.getGroups()) {
boost::shared_ptr<XMLElement> groupElement(new XMLElement("group"));
groupElement->addNode(boost::shared_ptr<XMLTextNode>(new XMLTextNode(group)));
itemElement->addNode(groupElement);
}
- if (!item.getUnknownContent().isEmpty()) {
+ if (!item.getUnknownContent().empty()) {
itemElement->addNode(boost::shared_ptr<XMLRawTextNode>(new XMLRawTextNode(item.getUnknownContent())));
}
diff --git a/Swiften/Serializer/PayloadSerializers/RosterSerializer.h b/Swiften/Serializer/PayloadSerializers/RosterSerializer.h
index ce73670..49e194b 100644
--- a/Swiften/Serializer/PayloadSerializers/RosterSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/RosterSerializer.h
@@ -15,7 +15,7 @@ namespace Swift {
public:
RosterSerializer();
- virtual String serializePayload(boost::shared_ptr<RosterPayload>) const;
+ virtual std::string serializePayload(boost::shared_ptr<RosterPayload>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/SearchPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/SearchPayloadSerializer.cpp
index 5d71fd3..a7a9fda 100644
--- a/Swiften/Serializer/PayloadSerializers/SearchPayloadSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/SearchPayloadSerializer.cpp
@@ -18,7 +18,7 @@ namespace Swift {
SearchPayloadSerializer::SearchPayloadSerializer() {
}
-String SearchPayloadSerializer::serializePayload(boost::shared_ptr<SearchPayload> searchPayload) const {
+std::string SearchPayloadSerializer::serializePayload(boost::shared_ptr<SearchPayload> searchPayload) const {
XMLElement searchElement("query", "jabber:iq:search");
if (searchPayload->getInstructions()) {
diff --git a/Swiften/Serializer/PayloadSerializers/SearchPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/SearchPayloadSerializer.h
index b64749b..2d8ec85 100644
--- a/Swiften/Serializer/PayloadSerializers/SearchPayloadSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/SearchPayloadSerializer.h
@@ -17,6 +17,6 @@ namespace Swift {
public:
SearchPayloadSerializer();
- virtual String serializePayload(boost::shared_ptr<SearchPayload>) const;
+ virtual std::string serializePayload(boost::shared_ptr<SearchPayload>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.cpp b/Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.cpp
index 841cb0a..b9ec55e 100644
--- a/Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.cpp
@@ -15,14 +15,14 @@ namespace Swift {
SecurityLabelSerializer::SecurityLabelSerializer() : GenericPayloadSerializer<SecurityLabel>() {
}
-String SecurityLabelSerializer::serializePayload(boost::shared_ptr<SecurityLabel> label) const {
+std::string SecurityLabelSerializer::serializePayload(boost::shared_ptr<SecurityLabel> label) const {
XMLElement element("securitylabel", "urn:xmpp:sec-label:0");
- if (!label->getDisplayMarking().isEmpty()) {
+ if (!label->getDisplayMarking().empty()) {
boost::shared_ptr<XMLElement> displayMarking(new XMLElement("displaymarking"));
- if (!label->getForegroundColor().isEmpty()) {
+ if (!label->getForegroundColor().empty()) {
displayMarking->setAttribute("fgcolor", label->getForegroundColor());
}
- if (!label->getBackgroundColor().isEmpty()) {
+ if (!label->getBackgroundColor().empty()) {
displayMarking->setAttribute("bgcolor", label->getBackgroundColor());
}
displayMarking->addNode(boost::shared_ptr<XMLTextNode>(new XMLTextNode(label->getDisplayMarking())));
@@ -33,7 +33,7 @@ String SecurityLabelSerializer::serializePayload(boost::shared_ptr<SecurityLabel
labelElement->addNode(boost::shared_ptr<XMLRawTextNode>(new XMLRawTextNode(label->getLabel())));
element.addNode(labelElement);
- foreach(const String& equivalentLabel, label->getEquivalentLabels()) {
+ foreach(const std::string& equivalentLabel, label->getEquivalentLabels()) {
boost::shared_ptr<XMLElement> equivalentLabelElement(new XMLElement("equivalentlabel"));
equivalentLabelElement->addNode(boost::shared_ptr<XMLRawTextNode>(new XMLRawTextNode(equivalentLabel)));
element.addNode(equivalentLabelElement);
diff --git a/Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.h b/Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.h
index 513655e..a02aeb9 100644
--- a/Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.h
@@ -15,7 +15,7 @@ namespace Swift {
public:
SecurityLabelSerializer();
- virtual String serializePayload(boost::shared_ptr<SecurityLabel> version) const;
+ virtual std::string serializePayload(boost::shared_ptr<SecurityLabel> version) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.cpp b/Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.cpp
index e44e30e..5e4d8e4 100644
--- a/Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.cpp
@@ -15,19 +15,19 @@ namespace Swift {
SecurityLabelsCatalogSerializer::SecurityLabelsCatalogSerializer() : GenericPayloadSerializer<SecurityLabelsCatalog>() {
}
-String SecurityLabelsCatalogSerializer::serializePayload(boost::shared_ptr<SecurityLabelsCatalog> catalog) const {
+std::string SecurityLabelsCatalogSerializer::serializePayload(boost::shared_ptr<SecurityLabelsCatalog> catalog) const {
XMLElement element("catalog", "urn:xmpp:sec-label:catalog:0");
- if (!catalog->getName().isEmpty()) {
+ if (!catalog->getName().empty()) {
element.setAttribute("name", catalog->getName());
}
if (catalog->getTo().isValid()) {
element.setAttribute("to", catalog->getTo());
}
- if (!catalog->getDescription().isEmpty()) {
+ if (!catalog->getDescription().empty()) {
element.setAttribute("desc", catalog->getDescription());
}
foreach (const SecurityLabel& label, catalog->getLabels()) {
- String serializedLabel = SecurityLabelSerializer().serialize(boost::shared_ptr<SecurityLabel>(new SecurityLabel(label)));
+ std::string serializedLabel = SecurityLabelSerializer().serialize(boost::shared_ptr<SecurityLabel>(new SecurityLabel(label)));
element.addNode(boost::shared_ptr<XMLRawTextNode>(new XMLRawTextNode(serializedLabel)));
}
return element.serialize();
diff --git a/Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.h b/Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.h
index 2379ec1..88a1541 100644
--- a/Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.h
@@ -15,7 +15,7 @@ namespace Swift {
public:
SecurityLabelsCatalogSerializer();
- virtual String serializePayload(boost::shared_ptr<SecurityLabelsCatalog> version) const;
+ virtual std::string serializePayload(boost::shared_ptr<SecurityLabelsCatalog> version) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.cpp b/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.cpp
index f38b2fd..b2eb1ed 100644
--- a/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.cpp
@@ -11,15 +11,15 @@ namespace Swift {
SoftwareVersionSerializer::SoftwareVersionSerializer() : GenericPayloadSerializer<SoftwareVersion>() {
}
-String SoftwareVersionSerializer::serializePayload(boost::shared_ptr<SoftwareVersion> version) const {
- String result("<query xmlns=\"jabber:iq:version\">");
- if (!version->getName().isEmpty()) {
+std::string SoftwareVersionSerializer::serializePayload(boost::shared_ptr<SoftwareVersion> version) const {
+ std::string result("<query xmlns=\"jabber:iq:version\">");
+ if (!version->getName().empty()) {
result += "<name>" + version->getName() + "</name>";
}
- if (!version->getVersion().isEmpty()) {
+ if (!version->getVersion().empty()) {
result += "<version>" + version->getVersion() + "</version>";
}
- if (!version->getOS().isEmpty()) {
+ if (!version->getOS().empty()) {
result += "<os>" + version->getOS() + "</os>";
}
result += "</query>";
diff --git a/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.h b/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.h
index 7f01b12..72f4afd 100644
--- a/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.h
@@ -15,7 +15,7 @@ namespace Swift {
public:
SoftwareVersionSerializer();
- virtual String serializePayload(boost::shared_ptr<SoftwareVersion> version) const;
+ virtual std::string serializePayload(boost::shared_ptr<SoftwareVersion> version) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/StartSessionSerializer.h b/Swiften/Serializer/PayloadSerializers/StartSessionSerializer.h
index 58930b4..dd9ba97 100644
--- a/Swiften/Serializer/PayloadSerializers/StartSessionSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/StartSessionSerializer.h
@@ -17,7 +17,7 @@ namespace Swift {
public:
StartSessionSerializer() : GenericPayloadSerializer<StartSession>() {}
- virtual String serializePayload(boost::shared_ptr<StartSession>) const {
+ virtual std::string serializePayload(boost::shared_ptr<StartSession>) const {
return XMLElement("session", "urn:ietf:params:xml:ns:xmpp-session").serialize();
}
};
diff --git a/Swiften/Serializer/PayloadSerializers/StatusSerializer.h b/Swiften/Serializer/PayloadSerializers/StatusSerializer.h
index 8de7040..565d554 100644
--- a/Swiften/Serializer/PayloadSerializers/StatusSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/StatusSerializer.h
@@ -17,7 +17,7 @@ namespace Swift {
public:
StatusSerializer() : GenericPayloadSerializer<Status>() {}
- virtual String serializePayload(boost::shared_ptr<Status> status) const {
+ virtual std::string serializePayload(boost::shared_ptr<Status> status) const {
XMLElement element("status");
element.addNode(boost::shared_ptr<XMLTextNode>(new XMLTextNode(status->getText())));
return element.serialize();
diff --git a/Swiften/Serializer/PayloadSerializers/StatusShowSerializer.h b/Swiften/Serializer/PayloadSerializers/StatusShowSerializer.h
index 9102fde..e797e81 100644
--- a/Swiften/Serializer/PayloadSerializers/StatusShowSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/StatusShowSerializer.h
@@ -15,12 +15,12 @@ namespace Swift {
public:
StatusShowSerializer() : GenericPayloadSerializer<StatusShow>() {}
- virtual String serializePayload(boost::shared_ptr<StatusShow> statusShow) const {
+ virtual std::string serializePayload(boost::shared_ptr<StatusShow> statusShow) const {
if (statusShow->getType () == StatusShow::Online || statusShow->getType() == StatusShow::None) {
return "";
}
else {
- String result("<show>");
+ std::string result("<show>");
switch (statusShow->getType()) {
case StatusShow::Away: result += "away"; break;
case StatusShow::XA: result += "xa"; break;
diff --git a/Swiften/Serializer/PayloadSerializers/StorageSerializer.cpp b/Swiften/Serializer/PayloadSerializers/StorageSerializer.cpp
index 0de75e5..049c797 100644
--- a/Swiften/Serializer/PayloadSerializers/StorageSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/StorageSerializer.cpp
@@ -17,7 +17,7 @@ namespace Swift {
StorageSerializer::StorageSerializer() : GenericPayloadSerializer<Storage>() {
}
-String StorageSerializer::serializePayload(boost::shared_ptr<Storage> storage) const {
+std::string StorageSerializer::serializePayload(boost::shared_ptr<Storage> storage) const {
XMLElement storageElement("storage", "storage:bookmarks");
foreach(const Storage::Room& room, storage->getRooms()) {
@@ -25,12 +25,12 @@ String StorageSerializer::serializePayload(boost::shared_ptr<Storage> storage) c
conferenceElement->setAttribute("name", room.name);
conferenceElement->setAttribute("jid", room.jid);
conferenceElement->setAttribute("autojoin", room.autoJoin ? "1" : "0");
- if (!room.nick.isEmpty()) {
+ if (!room.nick.empty()) {
boost::shared_ptr<XMLElement> nickElement(new XMLElement("nick"));
nickElement->addNode(boost::shared_ptr<XMLTextNode>(new XMLTextNode(room.nick)));
conferenceElement->addNode(nickElement);
}
- if (!room.password.isEmpty()) {
+ if (!room.password.empty()) {
boost::shared_ptr<XMLElement> passwordElement(new XMLElement("password"));
passwordElement->addNode(boost::shared_ptr<XMLTextNode>(new XMLTextNode(room.password)));
conferenceElement->addNode(passwordElement);
diff --git a/Swiften/Serializer/PayloadSerializers/StorageSerializer.h b/Swiften/Serializer/PayloadSerializers/StorageSerializer.h
index c045234..bc682a6 100644
--- a/Swiften/Serializer/PayloadSerializers/StorageSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/StorageSerializer.h
@@ -14,6 +14,6 @@ namespace Swift {
public:
StorageSerializer();
- virtual String serializePayload(boost::shared_ptr<Storage>) const;
+ virtual std::string serializePayload(boost::shared_ptr<Storage>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.cpp b/Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.cpp
index 0c7f593..70fb2ac 100644
--- a/Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.cpp
@@ -25,11 +25,11 @@ namespace Swift {
StreamInitiationSerializer::StreamInitiationSerializer() {
}
-String StreamInitiationSerializer::serializePayload(boost::shared_ptr<StreamInitiation> streamInitiation) const {
+std::string StreamInitiationSerializer::serializePayload(boost::shared_ptr<StreamInitiation> streamInitiation) const {
assert(streamInitiation->getIsFileTransfer());
XMLElement siElement("si", "http://jabber.org/protocol/si");
- if (!streamInitiation->getID().isEmpty()) {
+ if (!streamInitiation->getID().empty()) {
siElement.setAttribute("id", streamInitiation->getID());
}
siElement.setAttribute("profile", FILE_TRANSFER_NS);
@@ -41,7 +41,7 @@ String StreamInitiationSerializer::serializePayload(boost::shared_ptr<StreamInit
if (file.size != -1) {
fileElement->setAttribute("size", boost::lexical_cast<std::string>(file.size));
}
- if (!file.description.isEmpty()) {
+ if (!file.description.empty()) {
boost::shared_ptr<XMLElement> descElement(new XMLElement("desc"));
descElement->addNode(boost::shared_ptr<XMLTextNode>(new XMLTextNode(file.description)));
fileElement->addNode(descElement);
@@ -54,13 +54,13 @@ String StreamInitiationSerializer::serializePayload(boost::shared_ptr<StreamInit
Form::ref form(new Form(Form::FormType));
ListSingleFormField::ref field = ListSingleFormField::create();
field->setName("stream-method");
- foreach(const String& method, streamInitiation->getProvidedMethods()) {
+ foreach(const std::string& method, streamInitiation->getProvidedMethods()) {
field->addOption(FormField::Option("", method));
}
form->addField(field);
featureElement->addNode(boost::shared_ptr<XMLRawTextNode>(new XMLRawTextNode(FormSerializer().serialize(form))));
}
- else if (!streamInitiation->getRequestedMethod().isEmpty()) {
+ else if (!streamInitiation->getRequestedMethod().empty()) {
Form::ref form(new Form(Form::SubmitType));
ListSingleFormField::ref field = ListSingleFormField::create(streamInitiation->getRequestedMethod());
field->setName("stream-method");
diff --git a/Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.h b/Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.h
index 35c71b9..0b51519 100644
--- a/Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.h
@@ -16,6 +16,6 @@ namespace Swift {
public:
StreamInitiationSerializer();
- virtual String serializePayload(boost::shared_ptr<StreamInitiation>) const;
+ virtual std::string serializePayload(boost::shared_ptr<StreamInitiation>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/SubjectSerializer.h b/Swiften/Serializer/PayloadSerializers/SubjectSerializer.h
index fcd82a5..cf78ddd 100644
--- a/Swiften/Serializer/PayloadSerializers/SubjectSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/SubjectSerializer.h
@@ -15,7 +15,7 @@ namespace Swift {
public:
SubjectSerializer() : GenericPayloadSerializer<Subject>() {}
- virtual String serializePayload(boost::shared_ptr<Subject> subject) const {
+ virtual std::string serializePayload(boost::shared_ptr<Subject> subject) const {
XMLTextNode textNode(subject->getText());
return "<subject>" + textNode.serialize() + "</subject>";
}
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/CapsInfoSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/CapsInfoSerializerTest.cpp
index 87c5f9d..2604331 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/CapsInfoSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/CapsInfoSerializerTest.cpp
@@ -24,7 +24,7 @@ class CapsInfoSerializerTest : public CppUnit::TestFixture
CapsInfoSerializer testling;
boost::shared_ptr<CapsInfo> priority(new CapsInfo("http://swift.im", "myversion", "sha-1"));
- CPPUNIT_ASSERT_EQUAL(String("<c hash=\"sha-1\" node=\"http://swift.im\" ver=\"myversion\" xmlns=\"http://jabber.org/protocol/caps\"/>"), testling.serialize(priority));
+ CPPUNIT_ASSERT_EQUAL(std::string("<c hash=\"sha-1\" node=\"http://swift.im\" ver=\"myversion\" xmlns=\"http://jabber.org/protocol/caps\"/>"), testling.serialize(priority));
}
};
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/DiscoInfoSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/DiscoInfoSerializerTest.cpp
index c67fcdb..3875efd 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/DiscoInfoSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/DiscoInfoSerializerTest.cpp
@@ -30,7 +30,7 @@ class DiscoInfoSerializerTest : public CppUnit::TestFixture
discoInfo->addFeature("http://jabber.org/protocol/disco#info");
discoInfo->setNode("http://swift.im#bla");
- String expectedResult =
+ std::string expectedResult =
"<query node=\"http://swift.im#bla\" xmlns=\"http://jabber.org/protocol/disco#info\">"
"<identity category=\"client\" name=\"Swift\" type=\"pc\"/>"
"<identity category=\"client\" name=\"Vlug\" type=\"pc\" xml:lang=\"nl\"/>"
@@ -50,7 +50,7 @@ class DiscoInfoSerializerTest : public CppUnit::TestFixture
form->setTitle("Bot Configuration");
discoInfo->addExtension(form);
- String expectedResult =
+ std::string expectedResult =
"<query xmlns=\"http://jabber.org/protocol/disco#info\">"
"<feature var=\"http://jabber.org/protocol/caps\"/>"
"<feature var=\"http://jabber.org/protocol/disco#info\"/>"
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/ErrorSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/ErrorSerializerTest.cpp
index 2d392b0..dd06244 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/ErrorSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/ErrorSerializerTest.cpp
@@ -24,7 +24,7 @@ class ErrorSerializerTest : public CppUnit::TestFixture
ErrorSerializer testling;
boost::shared_ptr<ErrorPayload> error(new ErrorPayload(ErrorPayload::BadRequest, ErrorPayload::Cancel, "My Error"));
- CPPUNIT_ASSERT_EQUAL(String("<error type=\"cancel\"><bad-request xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\"/><text xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\">My Error</text></error>"), testling.serialize(error));
+ CPPUNIT_ASSERT_EQUAL(std::string("<error type=\"cancel\"><bad-request xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\"/><text xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\">My Error</text></error>"), testling.serialize(error));
}
};
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/FormSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/FormSerializerTest.cpp
index 4ed3ba9..e4a6661 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/FormSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/FormSerializerTest.cpp
@@ -24,7 +24,7 @@ class FormSerializerTest : public CppUnit::TestFixture {
form->setTitle("Bot Configuration");
form->setInstructions("Hello!\nFill out this form to configure your new bot!");
- CPPUNIT_ASSERT_EQUAL(String(
+ CPPUNIT_ASSERT_EQUAL(std::string(
"<x type=\"form\" xmlns=\"jabber:x:data\">"
"<title>Bot Configuration</title>"
"<instructions>Hello!</instructions>"
@@ -63,7 +63,7 @@ class FormSerializerTest : public CppUnit::TestFixture {
field->setLabel("Password for special access");
form->addField(field);
- std::vector<String> values;
+ std::vector<std::string> values;
values.push_back("news");
values.push_back("search");
field = ListMultiFormField::create(values);
@@ -96,14 +96,14 @@ class FormSerializerTest : public CppUnit::TestFixture {
field->setDescription("Tell all your friends about your new bot!");
form->addField(field);
- std::vector<String> values2;
+ std::vector<std::string> values2;
values2.push_back("foo");
values2.push_back("bar");
field = UntypedFormField::create(values2);
field->setName("fum");
form->addField(field);
- CPPUNIT_ASSERT_EQUAL(String(
+ CPPUNIT_ASSERT_EQUAL(std::string(
"<x type=\"form\" xmlns=\"jabber:x:data\">"
"<field type=\"hidden\" var=\"FORM_TYPE\">"
"<value>jabber:bot</value>"
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/InBandRegistrationPayloadSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/InBandRegistrationPayloadSerializerTest.cpp
index 1654abc..7020537 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/InBandRegistrationPayloadSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/InBandRegistrationPayloadSerializerTest.cpp
@@ -23,7 +23,7 @@ class InBandRegistrationPayloadSerializerTest : public CppUnit::TestFixture {
boost::shared_ptr<InBandRegistrationPayload> registration(new InBandRegistrationPayload());
registration->setRegistered(true);
- String expectedResult =
+ std::string expectedResult =
"<query xmlns=\"jabber:iq:register\">"
"<registered/>"
"</query>";
@@ -43,7 +43,7 @@ class InBandRegistrationPayloadSerializerTest : public CppUnit::TestFixture {
form->addField(field);
registration->setForm(form);
- String expectedResult =
+ std::string expectedResult =
"<query xmlns=\"jabber:iq:register\">"
"<instructions>Use the enclosed form to register.</instructions>"
"<x type=\"form\" xmlns=\"jabber:x:data\">"
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.cpp
index d1dbba9..481d9c2 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.cpp
@@ -12,7 +12,7 @@
namespace Swift {
-String PayloadsSerializer::serialize(boost::shared_ptr<Payload> payload) {
+std::string PayloadsSerializer::serialize(boost::shared_ptr<Payload> payload) {
PayloadSerializer* serializer = serializers.getPayloadSerializer(payload);
if (serializer) {
return serializer->serialize(payload);
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.h b/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.h
index 066c481..038b616 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.h
@@ -9,13 +9,13 @@
#include <boost/shared_ptr.hpp>
#include "Swiften/Elements/Payload.h"
-#include "Swiften/Base/String.h"
+#include <string>
#include "Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.h"
namespace Swift {
class PayloadsSerializer {
public:
- String serialize(boost::shared_ptr<Payload> payload);
+ std::string serialize(boost::shared_ptr<Payload> payload);
private:
FullPayloadSerializerCollection serializers;
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/PrioritySerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/PrioritySerializerTest.cpp
index 12d9359..c976b12 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/PrioritySerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/PrioritySerializerTest.cpp
@@ -24,7 +24,7 @@ class PrioritySerializerTest : public CppUnit::TestFixture
PrioritySerializer testling;
boost::shared_ptr<Priority> priority(new Priority(-113));
- CPPUNIT_ASSERT_EQUAL(String("<priority>-113</priority>"), testling.serialize(priority));
+ CPPUNIT_ASSERT_EQUAL(std::string("<priority>-113</priority>"), testling.serialize(priority));
}
};
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/PrivateStorageSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/PrivateStorageSerializerTest.cpp
index 59df665..b0f4084 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/PrivateStorageSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/PrivateStorageSerializerTest.cpp
@@ -33,7 +33,7 @@ class PrivateStorageSerializerTest : public CppUnit::TestFixture {
storage->addRoom(room);
privateStorage->setPayload(storage);
- CPPUNIT_ASSERT_EQUAL(String(
+ CPPUNIT_ASSERT_EQUAL(std::string(
"<query xmlns=\"jabber:iq:private\">"
"<storage xmlns=\"storage:bookmarks\">"
"<conference "
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/ResourceBindSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/ResourceBindSerializerTest.cpp
index 83b75a9..c7872fe 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/ResourceBindSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/ResourceBindSerializerTest.cpp
@@ -27,7 +27,7 @@ class ResourceBindSerializerTest : public CppUnit::TestFixture
boost::shared_ptr<ResourceBind> resourceBind(new ResourceBind());
resourceBind->setJID(JID("somenode@example.com/someresource"));
- CPPUNIT_ASSERT_EQUAL(String(
+ CPPUNIT_ASSERT_EQUAL(std::string(
"<bind xmlns=\"urn:ietf:params:xml:ns:xmpp-bind\">"
"<jid>somenode@example.com/someresource</jid>"
"</bind>"), testling.serialize(resourceBind));
@@ -38,7 +38,7 @@ class ResourceBindSerializerTest : public CppUnit::TestFixture
boost::shared_ptr<ResourceBind> resourceBind(new ResourceBind());
resourceBind->setResource("someresource");
- CPPUNIT_ASSERT_EQUAL(String(
+ CPPUNIT_ASSERT_EQUAL(std::string(
"<bind xmlns=\"urn:ietf:params:xml:ns:xmpp-bind\">"
"<resource>someresource</resource>"
"</bind>"), testling.serialize(resourceBind));
@@ -48,7 +48,7 @@ class ResourceBindSerializerTest : public CppUnit::TestFixture
ResourceBindSerializer testling;
boost::shared_ptr<ResourceBind> resourceBind(new ResourceBind());
- CPPUNIT_ASSERT_EQUAL(String("<bind xmlns=\"urn:ietf:params:xml:ns:xmpp-bind\"/>"), testling.serialize(resourceBind));
+ CPPUNIT_ASSERT_EQUAL(std::string("<bind xmlns=\"urn:ietf:params:xml:ns:xmpp-bind\"/>"), testling.serialize(resourceBind));
}
};
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/RosterSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/RosterSerializerTest.cpp
index bf30db8..b8ceac3 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/RosterSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/RosterSerializerTest.cpp
@@ -39,7 +39,7 @@ class RosterSerializerTest : public CppUnit::TestFixture
item2.setName("Baz");
roster->addItem(item2);
- String expectedResult =
+ std::string expectedResult =
"<query xmlns=\"jabber:iq:roster\">"
"<item ask=\"subscribe\" jid=\"foo@bar.com\" name=\"Foo @ Bar\" subscription=\"from\">"
"<group>Group 1</group>"
@@ -60,12 +60,12 @@ class RosterSerializerTest : public CppUnit::TestFixture
item.setName("Baz");
item.addGroup("Group 1");
item.addGroup("Group 2");
- item.addUnknownContent(String(
+ item.addUnknownContent(std::string(
"<foo xmlns=\"http://example.com\"><bar xmlns=\"http://example.com\">Baz</bar></foo>"
"<baz xmlns=\"jabber:iq:roster\"><fum xmlns=\"jabber:iq:roster\">foo</fum></baz>"));
roster->addItem(item);
- String expectedResult =
+ std::string expectedResult =
"<query xmlns=\"jabber:iq:roster\">"
"<item jid=\"baz@blo.com\" name=\"Baz\" subscription=\"none\">"
"<group>Group 1</group>"
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/SearchPayloadSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/SearchPayloadSerializerTest.cpp
index 40951ec..e8328b8 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/SearchPayloadSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/SearchPayloadSerializerTest.cpp
@@ -25,7 +25,7 @@ class SearchPayloadSerializerTest : public CppUnit::TestFixture {
payload->setFirst("Juliet");
payload->setLast("Capulet");
- CPPUNIT_ASSERT_EQUAL(String(
+ CPPUNIT_ASSERT_EQUAL(std::string(
"<query xmlns=\"jabber:iq:search\">"
"<first>Juliet</first>"
"<last>Capulet</last>"
@@ -53,7 +53,7 @@ class SearchPayloadSerializerTest : public CppUnit::TestFixture {
item2.email = "tybalt@shakespeare.lit";
payload->addItem(item2);
- CPPUNIT_ASSERT_EQUAL(String(
+ CPPUNIT_ASSERT_EQUAL(std::string(
"<query xmlns=\"jabber:iq:search\">"
"<item jid=\"juliet@capulet.com\">"
"<first>Juliet</first>"
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelSerializerTest.cpp
index bf2139e..03bad89 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelSerializerTest.cpp
@@ -28,7 +28,7 @@ class SecurityLabelSerializerTest : public CppUnit::TestFixture {
securityLabel->addEquivalentLabel("<icismlabel xmlns=\"http://example.gov/IC-ISM/0\" classification=\"S\" ownerProducer=\"USA\" disseminationControls=\"FOUO\"/>");
securityLabel->addEquivalentLabel("<esssecuritylabel xmlns=\"urn:xmpp:sec-label:ess:0\">MRUCAgD9DA9BcXVhIChvYnNvbGV0ZSk=</esssecuritylabel>");
- CPPUNIT_ASSERT_EQUAL(String(
+ CPPUNIT_ASSERT_EQUAL(std::string(
"<securitylabel xmlns=\"urn:xmpp:sec-label:0\">"
"<displaymarking bgcolor=\"red\" fgcolor=\"black\">SECRET</displaymarking>"
"<label>"
@@ -49,7 +49,7 @@ class SecurityLabelSerializerTest : public CppUnit::TestFixture {
securityLabel->setDisplayMarking("SECRET");
securityLabel->setLabel("");
- CPPUNIT_ASSERT_EQUAL(String(
+ CPPUNIT_ASSERT_EQUAL(std::string(
"<securitylabel xmlns=\"urn:xmpp:sec-label:0\">"
"<displaymarking>SECRET</displaymarking>"
"<label></label>"
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelsCatalogSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelsCatalogSerializerTest.cpp
index 9d471d1..928f209 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelsCatalogSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelsCatalogSerializerTest.cpp
@@ -41,7 +41,7 @@ class SecurityLabelsCatalogSerializerTest : public CppUnit::TestFixture
securityLabel2.setLabel("<esssecuritylabel xmlns=\"urn:xmpp:sec-label:ess:0\">MQMGASk=</esssecuritylabel>");
catalog->addLabel(securityLabel2);
- CPPUNIT_ASSERT_EQUAL(String(
+ CPPUNIT_ASSERT_EQUAL(std::string(
"<catalog desc=\"an example set of labels\" name=\"Default\" to=\"example.com\" xmlns=\"urn:xmpp:sec-label:catalog:0\">"
"<securitylabel xmlns=\"urn:xmpp:sec-label:0\">"
"<displaymarking bgcolor=\"red\" fgcolor=\"black\">SECRET</displaymarking>"
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/SoftwareVersionSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/SoftwareVersionSerializerTest.cpp
index 963df9f..6fac094 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/SoftwareVersionSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/SoftwareVersionSerializerTest.cpp
@@ -24,7 +24,7 @@ class SoftwareVersionSerializerTest : public CppUnit::TestFixture
SoftwareVersionSerializer testling;
boost::shared_ptr<SoftwareVersion> softwareVersion(new SoftwareVersion("Swift", "0.1", "Mac OS X"));
- CPPUNIT_ASSERT_EQUAL(String("<query xmlns=\"jabber:iq:version\"><name>Swift</name><version>0.1</version><os>Mac OS X</os></query>"), testling.serialize(softwareVersion));
+ CPPUNIT_ASSERT_EQUAL(std::string("<query xmlns=\"jabber:iq:version\"><name>Swift</name><version>0.1</version><os>Mac OS X</os></query>"), testling.serialize(softwareVersion));
}
};
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/StatusSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/StatusSerializerTest.cpp
index 9a8c9d9..c0b1dc2 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/StatusSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/StatusSerializerTest.cpp
@@ -24,7 +24,7 @@ class StatusSerializerTest : public CppUnit::TestFixture
StatusSerializer testling;
boost::shared_ptr<Status> status(new Status("I am away"));
- CPPUNIT_ASSERT_EQUAL(String("<status>I am away</status>"), testling.serialize(status));
+ CPPUNIT_ASSERT_EQUAL(std::string("<status>I am away</status>"), testling.serialize(status));
}
};
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/StatusShowSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/StatusShowSerializerTest.cpp
index f165f1c..2fee152 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/StatusShowSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/StatusShowSerializerTest.cpp
@@ -27,37 +27,37 @@ class StatusShowSerializerTest : public CppUnit::TestFixture
void testSerialize_Online() {
StatusShowSerializer testling;
boost::shared_ptr<StatusShow> statusShow(new StatusShow(StatusShow::Online));
- CPPUNIT_ASSERT_EQUAL(String(""), testling.serialize(statusShow));
+ CPPUNIT_ASSERT_EQUAL(std::string(""), testling.serialize(statusShow));
}
void testSerialize_Away() {
StatusShowSerializer testling;
boost::shared_ptr<StatusShow> statusShow(new StatusShow(StatusShow::Away));
- CPPUNIT_ASSERT_EQUAL(String("<show>away</show>"), testling.serialize(statusShow));
+ CPPUNIT_ASSERT_EQUAL(std::string("<show>away</show>"), testling.serialize(statusShow));
}
void testSerialize_FFC() {
StatusShowSerializer testling;
boost::shared_ptr<StatusShow> statusShow(new StatusShow(StatusShow::FFC));
- CPPUNIT_ASSERT_EQUAL(String("<show>chat</show>"), testling.serialize(statusShow));
+ CPPUNIT_ASSERT_EQUAL(std::string("<show>chat</show>"), testling.serialize(statusShow));
}
void testSerialize_XA() {
StatusShowSerializer testling;
boost::shared_ptr<StatusShow> statusShow(new StatusShow(StatusShow::XA));
- CPPUNIT_ASSERT_EQUAL(String("<show>xa</show>"), testling.serialize(statusShow));
+ CPPUNIT_ASSERT_EQUAL(std::string("<show>xa</show>"), testling.serialize(statusShow));
}
void testSerialize_DND() {
StatusShowSerializer testling;
boost::shared_ptr<StatusShow> statusShow(new StatusShow(StatusShow::DND));
- CPPUNIT_ASSERT_EQUAL(String("<show>dnd</show>"), testling.serialize(statusShow));
+ CPPUNIT_ASSERT_EQUAL(std::string("<show>dnd</show>"), testling.serialize(statusShow));
}
void testSerialize_None() {
StatusShowSerializer testling;
boost::shared_ptr<StatusShow> statusShow(new StatusShow(StatusShow::None));
- CPPUNIT_ASSERT_EQUAL(String(""), testling.serialize(statusShow));
+ CPPUNIT_ASSERT_EQUAL(std::string(""), testling.serialize(statusShow));
}
};
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/StorageSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/StorageSerializerTest.cpp
index 8add953..01899a9 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/StorageSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/StorageSerializerTest.cpp
@@ -36,7 +36,7 @@ class StorageSerializerTest : public CppUnit::TestFixture {
url.url = "http://the-tech.mit.edu/Shakespeare/";
storage->addURL(url);
- CPPUNIT_ASSERT_EQUAL(String(
+ CPPUNIT_ASSERT_EQUAL(std::string(
"<storage xmlns=\"storage:bookmarks\">"
"<conference "
"autojoin=\"1\" "
@@ -58,7 +58,7 @@ class StorageSerializerTest : public CppUnit::TestFixture {
room.jid = JID("council@conference.underhill.org");
storage->addRoom(room);
- CPPUNIT_ASSERT_EQUAL(String(
+ CPPUNIT_ASSERT_EQUAL(std::string(
"<storage xmlns=\"storage:bookmarks\">"
"<conference "
"autojoin=\"1\" "
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/StreamInitiationSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/StreamInitiationSerializerTest.cpp
index e1a13b8..d05fdba 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/StreamInitiationSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/StreamInitiationSerializerTest.cpp
@@ -28,7 +28,7 @@ class StreamInitiationSerializerTest : public CppUnit::TestFixture{
streamInitiation->addProvidedMethod("jabber:iq:oob");
streamInitiation->addProvidedMethod("http://jabber.org/protocol/ibb");
- CPPUNIT_ASSERT_EQUAL(String(
+ CPPUNIT_ASSERT_EQUAL(std::string(
"<si id=\"a0\" profile=\"http://jabber.org/protocol/si/profile/file-transfer\" xmlns=\"http://jabber.org/protocol/si\">"
"<file name=\"test.txt\" size=\"1022\" xmlns=\"http://jabber.org/protocol/si/profile/file-transfer\">"
"<desc>This is info about the file.</desc>"
@@ -51,7 +51,7 @@ class StreamInitiationSerializerTest : public CppUnit::TestFixture{
boost::shared_ptr<StreamInitiation> streamInitiation(new StreamInitiation());
streamInitiation->setRequestedMethod("http://jabber.org/protocol/bytestreams");
- CPPUNIT_ASSERT_EQUAL(String(
+ CPPUNIT_ASSERT_EQUAL(std::string(
"<si profile=\"http://jabber.org/protocol/si/profile/file-transfer\" xmlns=\"http://jabber.org/protocol/si\">"
"<feature xmlns=\"http://jabber.org/protocol/feature-neg\">"
"<x type=\"submit\" xmlns=\"jabber:x:data\">"
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/VCardSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/VCardSerializerTest.cpp
index 82a3ec8..8a9a615 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/VCardSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/VCardSerializerTest.cpp
@@ -46,7 +46,7 @@ class VCardSerializerTest : public CppUnit::TestFixture
address2.isX400 = true;
vcard->addEMailAddress(address2);
- String expectedResult =
+ std::string expectedResult =
"<vCard xmlns=\"vcard-temp\">"
"<VERSION>2.0</VERSION>"
"<FN>Alice In Wonderland</FN>"
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/VCardUpdateSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/VCardUpdateSerializerTest.cpp
index a926142..6f37d61 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/VCardUpdateSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/VCardUpdateSerializerTest.cpp
@@ -25,7 +25,7 @@ class VCardUpdateSerializerTest : public CppUnit::TestFixture
boost::shared_ptr<VCardUpdate> update(new VCardUpdate());
update->setPhotoHash("sha1-hash-of-image");
- String expectedResult =
+ std::string expectedResult =
"<x xmlns=\"vcard-temp:x:update\">"
"<photo>sha1-hash-of-image</photo>"
"</x>";
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();
diff --git a/Swiften/Serializer/PayloadSerializers/VCardSerializer.h b/Swiften/Serializer/PayloadSerializers/VCardSerializer.h
index 79f0524..7b9a8a9 100644
--- a/Swiften/Serializer/PayloadSerializers/VCardSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/VCardSerializer.h
@@ -14,6 +14,6 @@ namespace Swift {
public:
VCardSerializer();
- virtual String serializePayload(boost::shared_ptr<VCard>) const;
+ virtual std::string serializePayload(boost::shared_ptr<VCard>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/VCardUpdateSerializer.cpp b/Swiften/Serializer/PayloadSerializers/VCardUpdateSerializer.cpp
index f95995d..e315bc3 100644
--- a/Swiften/Serializer/PayloadSerializers/VCardUpdateSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/VCardUpdateSerializer.cpp
@@ -16,7 +16,7 @@ namespace Swift {
VCardUpdateSerializer::VCardUpdateSerializer() : GenericPayloadSerializer<VCardUpdate>() {
}
-String VCardUpdateSerializer::serializePayload(boost::shared_ptr<VCardUpdate> vcardUpdate) const {
+std::string VCardUpdateSerializer::serializePayload(boost::shared_ptr<VCardUpdate> vcardUpdate) const {
XMLElement updateElement("x", "vcard-temp:x:update");
boost::shared_ptr<XMLElement> photoElement(new XMLElement("photo"));
photoElement->addNode(boost::shared_ptr<XMLTextNode>(new XMLTextNode(vcardUpdate->getPhotoHash())));
diff --git a/Swiften/Serializer/PayloadSerializers/VCardUpdateSerializer.h b/Swiften/Serializer/PayloadSerializers/VCardUpdateSerializer.h
index 19610eb..46ca154 100644
--- a/Swiften/Serializer/PayloadSerializers/VCardUpdateSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/VCardUpdateSerializer.h
@@ -14,6 +14,6 @@ namespace Swift {
public:
VCardUpdateSerializer();
- virtual String serializePayload(boost::shared_ptr<VCardUpdate>) const;
+ virtual std::string serializePayload(boost::shared_ptr<VCardUpdate>) const;
};
}
diff --git a/Swiften/Serializer/StanzaAckRequestSerializer.h b/Swiften/Serializer/StanzaAckRequestSerializer.h
index 26d015d..b03a2c2 100644
--- a/Swiften/Serializer/StanzaAckRequestSerializer.h
+++ b/Swiften/Serializer/StanzaAckRequestSerializer.h
@@ -18,7 +18,7 @@ namespace Swift {
StanzaAckRequestSerializer() : GenericElementSerializer<StanzaAckRequest>() {
}
- virtual String serialize(boost::shared_ptr<Element>) const {
+ virtual std::string serialize(boost::shared_ptr<Element>) const {
return XMLElement("r", "urn:xmpp:sm:2").serialize();
}
};
diff --git a/Swiften/Serializer/StanzaAckSerializer.h b/Swiften/Serializer/StanzaAckSerializer.h
index d29fbde..984509f 100644
--- a/Swiften/Serializer/StanzaAckSerializer.h
+++ b/Swiften/Serializer/StanzaAckSerializer.h
@@ -19,11 +19,11 @@ namespace Swift {
StanzaAckSerializer() : GenericElementSerializer<StanzaAck>() {
}
- virtual String serialize(boost::shared_ptr<Element> element) const {
+ virtual std::string serialize(boost::shared_ptr<Element> element) const {
StanzaAck::ref stanzaAck(boost::dynamic_pointer_cast<StanzaAck>(element));
assert(stanzaAck->isValid());
XMLElement result("a", "urn:xmpp:sm:2");
- result.setAttribute("h", String(boost::lexical_cast<std::string>(stanzaAck->getHandledStanzasCount())));
+ result.setAttribute("h", std::string(boost::lexical_cast<std::string>(stanzaAck->getHandledStanzasCount())));
return result.serialize();
}
};
diff --git a/Swiften/Serializer/StanzaSerializer.cpp b/Swiften/Serializer/StanzaSerializer.cpp
index 36976ce..cfc9a43 100644
--- a/Swiften/Serializer/StanzaSerializer.cpp
+++ b/Swiften/Serializer/StanzaSerializer.cpp
@@ -18,10 +18,10 @@
namespace Swift {
-StanzaSerializer::StanzaSerializer(const String& tag, PayloadSerializerCollection* payloadSerializers) : tag_(tag), payloadSerializers_(payloadSerializers) {
+StanzaSerializer::StanzaSerializer(const std::string& tag, PayloadSerializerCollection* payloadSerializers) : tag_(tag), payloadSerializers_(payloadSerializers) {
}
-String StanzaSerializer::serialize(boost::shared_ptr<Element> element) const {
+std::string StanzaSerializer::serialize(boost::shared_ptr<Element> element) const {
boost::shared_ptr<Stanza> stanza(boost::dynamic_pointer_cast<Stanza>(element));
XMLElement stanzaElement(tag_);
@@ -31,12 +31,12 @@ String StanzaSerializer::serialize(boost::shared_ptr<Element> element) const {
if (stanza->getTo().isValid()) {
stanzaElement.setAttribute("to", stanza->getTo());
}
- if (!stanza->getID().isEmpty()) {
+ if (!stanza->getID().empty()) {
stanzaElement.setAttribute("id", stanza->getID());
}
setStanzaSpecificAttributes(stanza, stanzaElement);
- String serializedPayloads;
+ std::string serializedPayloads;
foreach (const boost::shared_ptr<Payload>& payload, stanza->getPayloads()) {
PayloadSerializer* serializer = payloadSerializers_->getPayloadSerializer(payload);
if (serializer) {
@@ -46,7 +46,7 @@ String StanzaSerializer::serialize(boost::shared_ptr<Element> element) const {
std::cerr << "Could not find serializer for " << typeid(*(payload.get())).name() << std::endl;
}
}
- if (!serializedPayloads.isEmpty()) {
+ if (!serializedPayloads.empty()) {
stanzaElement.addNode(boost::shared_ptr<XMLNode>(new XMLRawTextNode(serializedPayloads)));
}
diff --git a/Swiften/Serializer/StanzaSerializer.h b/Swiften/Serializer/StanzaSerializer.h
index e89665c..505d320 100644
--- a/Swiften/Serializer/StanzaSerializer.h
+++ b/Swiften/Serializer/StanzaSerializer.h
@@ -9,7 +9,7 @@
#include "Swiften/Elements/Stanza.h"
#include "Swiften/Serializer/ElementSerializer.h"
-#include "Swiften/Base/String.h"
+#include <string>
namespace Swift {
class PayloadSerializerCollection;
@@ -17,13 +17,13 @@ namespace Swift {
class StanzaSerializer : public ElementSerializer {
public:
- StanzaSerializer(const String& tag, PayloadSerializerCollection* payloadSerializers);
+ StanzaSerializer(const std::string& tag, PayloadSerializerCollection* payloadSerializers);
- virtual String serialize(boost::shared_ptr<Element>) const;
+ virtual std::string serialize(boost::shared_ptr<Element>) const;
virtual void setStanzaSpecificAttributes(boost::shared_ptr<Element>, XMLElement&) const = 0;
private:
- String tag_;
+ std::string tag_;
PayloadSerializerCollection* payloadSerializers_;
};
}
diff --git a/Swiften/Serializer/StartTLSFailureSerializer.h b/Swiften/Serializer/StartTLSFailureSerializer.h
index 8827db6..548a24c 100644
--- a/Swiften/Serializer/StartTLSFailureSerializer.h
+++ b/Swiften/Serializer/StartTLSFailureSerializer.h
@@ -19,7 +19,7 @@ namespace Swift {
StartTLSFailureSerializer() : GenericElementSerializer<StartTLSFailure>() {
}
- virtual String serialize(boost::shared_ptr<Element>) const {
+ virtual std::string serialize(boost::shared_ptr<Element>) const {
return XMLElement("failure", "urn:ietf:params:xml:ns:xmpp-tls").serialize();
}
};
diff --git a/Swiften/Serializer/StartTLSRequestSerializer.h b/Swiften/Serializer/StartTLSRequestSerializer.h
index 5599f2a..2e9ecfa 100644
--- a/Swiften/Serializer/StartTLSRequestSerializer.h
+++ b/Swiften/Serializer/StartTLSRequestSerializer.h
@@ -19,7 +19,7 @@ namespace Swift {
StartTLSRequestSerializer() : GenericElementSerializer<StartTLSRequest>() {
}
- virtual String serialize(boost::shared_ptr<Element>) const {
+ virtual std::string serialize(boost::shared_ptr<Element>) const {
return XMLElement("starttls", "urn:ietf:params:xml:ns:xmpp-tls").serialize();
}
};
diff --git a/Swiften/Serializer/StreamErrorSerializer.cpp b/Swiften/Serializer/StreamErrorSerializer.cpp
index b88f5c4..11f8a30 100644
--- a/Swiften/Serializer/StreamErrorSerializer.cpp
+++ b/Swiften/Serializer/StreamErrorSerializer.cpp
@@ -15,11 +15,11 @@ namespace Swift {
StreamErrorSerializer::StreamErrorSerializer() : GenericElementSerializer<StreamError>() {
}
-String StreamErrorSerializer::serialize(boost::shared_ptr<Element> element) const {
+std::string StreamErrorSerializer::serialize(boost::shared_ptr<Element> element) const {
StreamError::ref error = boost::dynamic_pointer_cast<StreamError>(element);
XMLElement errorElement("error", "http://etherx.jabber.org/streams");
- String typeTag;
+ std::string typeTag;
switch (error->getType()) {
case StreamError::BadFormat: typeTag = "bad-format"; break;
case StreamError::BadNamespacePrefix: typeTag = "bad-namespace-prefix"; break;
@@ -49,7 +49,7 @@ String StreamErrorSerializer::serialize(boost::shared_ptr<Element> element) con
}
errorElement.addNode(boost::make_shared<XMLElement>(typeTag, "urn:ietf:params:xml:ns:xmpp-streams"));
- if (!error->getText().isEmpty()) {
+ if (!error->getText().empty()) {
errorElement.addNode(boost::make_shared<XMLElement>("text", "urn:ietf:params:xml:ns:xmpp-streams", error->getText()));
}
diff --git a/Swiften/Serializer/StreamErrorSerializer.h b/Swiften/Serializer/StreamErrorSerializer.h
index 1a7bb79..9d4f60c 100644
--- a/Swiften/Serializer/StreamErrorSerializer.h
+++ b/Swiften/Serializer/StreamErrorSerializer.h
@@ -14,6 +14,6 @@ namespace Swift {
public:
StreamErrorSerializer();
- virtual String serialize(boost::shared_ptr<Element> error) const;
+ virtual std::string serialize(boost::shared_ptr<Element> error) const;
};
}
diff --git a/Swiften/Serializer/StreamFeaturesSerializer.cpp b/Swiften/Serializer/StreamFeaturesSerializer.cpp
index ec21983..915433c 100644
--- a/Swiften/Serializer/StreamFeaturesSerializer.cpp
+++ b/Swiften/Serializer/StreamFeaturesSerializer.cpp
@@ -15,7 +15,7 @@ namespace Swift {
StreamFeaturesSerializer::StreamFeaturesSerializer() {
}
-String StreamFeaturesSerializer::serialize(boost::shared_ptr<Element> element) const {
+std::string StreamFeaturesSerializer::serialize(boost::shared_ptr<Element> element) const {
boost::shared_ptr<StreamFeatures> streamFeatures(boost::dynamic_pointer_cast<StreamFeatures>(element));
XMLElement streamFeaturesElement("stream:features");
@@ -24,7 +24,7 @@ String StreamFeaturesSerializer::serialize(boost::shared_ptr<Element> element)
}
if (!streamFeatures->getCompressionMethods().empty()) {
boost::shared_ptr<XMLElement> compressionElement(new XMLElement("compression", "http://jabber.org/features/compress"));
- foreach(const String& method, streamFeatures->getCompressionMethods()) {
+ foreach(const std::string& method, streamFeatures->getCompressionMethods()) {
boost::shared_ptr<XMLElement> methodElement(new XMLElement("method"));
methodElement->addNode(boost::shared_ptr<XMLTextNode>(new XMLTextNode(method)));
compressionElement->addNode(methodElement);
@@ -33,7 +33,7 @@ String StreamFeaturesSerializer::serialize(boost::shared_ptr<Element> element)
}
if (!streamFeatures->getAuthenticationMechanisms().empty()) {
boost::shared_ptr<XMLElement> mechanismsElement(new XMLElement("mechanisms", "urn:ietf:params:xml:ns:xmpp-sasl"));
- foreach(const String& mechanism, streamFeatures->getAuthenticationMechanisms()) {
+ foreach(const std::string& mechanism, streamFeatures->getAuthenticationMechanisms()) {
boost::shared_ptr<XMLElement> mechanismElement(new XMLElement("mechanism"));
mechanismElement->addNode(boost::shared_ptr<XMLTextNode>(new XMLTextNode(mechanism)));
mechanismsElement->addNode(mechanismElement);
diff --git a/Swiften/Serializer/StreamFeaturesSerializer.h b/Swiften/Serializer/StreamFeaturesSerializer.h
index 004a1e5..3b475e0 100644
--- a/Swiften/Serializer/StreamFeaturesSerializer.h
+++ b/Swiften/Serializer/StreamFeaturesSerializer.h
@@ -17,7 +17,7 @@ namespace Swift {
public:
StreamFeaturesSerializer();
- virtual String serialize(boost::shared_ptr<Element> element) const;
+ virtual std::string serialize(boost::shared_ptr<Element> element) const;
};
}
diff --git a/Swiften/Serializer/StreamManagementEnabledSerializer.h b/Swiften/Serializer/StreamManagementEnabledSerializer.h
index a135390..fc7bd86 100644
--- a/Swiften/Serializer/StreamManagementEnabledSerializer.h
+++ b/Swiften/Serializer/StreamManagementEnabledSerializer.h
@@ -18,7 +18,7 @@ namespace Swift {
StreamManagementEnabledSerializer() : GenericElementSerializer<StreamManagementEnabled>() {
}
- virtual String serialize(boost::shared_ptr<Element>) const {
+ virtual std::string serialize(boost::shared_ptr<Element>) const {
return XMLElement("enabled", "urn:xmpp:sm:2").serialize();
}
};
diff --git a/Swiften/Serializer/StreamManagementFailedSerializer.h b/Swiften/Serializer/StreamManagementFailedSerializer.h
index d6aa24b..b22ed0d 100644
--- a/Swiften/Serializer/StreamManagementFailedSerializer.h
+++ b/Swiften/Serializer/StreamManagementFailedSerializer.h
@@ -18,7 +18,7 @@ namespace Swift {
StreamManagementFailedSerializer() : GenericElementSerializer<StreamManagementFailed>() {
}
- virtual String serialize(boost::shared_ptr<Element>) const {
+ virtual std::string serialize(boost::shared_ptr<Element>) const {
return XMLElement("failed", "urn:xmpp:sm:2").serialize();
}
};
diff --git a/Swiften/Serializer/TLSProceedSerializer.h b/Swiften/Serializer/TLSProceedSerializer.h
index 217a272..1b08c23 100644
--- a/Swiften/Serializer/TLSProceedSerializer.h
+++ b/Swiften/Serializer/TLSProceedSerializer.h
@@ -19,7 +19,7 @@ namespace Swift {
TLSProceedSerializer() : GenericElementSerializer<TLSProceed>() {
}
- virtual String serialize(boost::shared_ptr<Element>) const {
+ virtual std::string serialize(boost::shared_ptr<Element>) const {
return XMLElement("proceed", "urn:ietf:params:xml:ns:xmpp-tls").serialize();
}
};
diff --git a/Swiften/Serializer/UnitTest/AuthChallengeSerializerTest.cpp b/Swiften/Serializer/UnitTest/AuthChallengeSerializerTest.cpp
index dc828e0..af857ef 100644
--- a/Swiften/Serializer/UnitTest/AuthChallengeSerializerTest.cpp
+++ b/Swiften/Serializer/UnitTest/AuthChallengeSerializerTest.cpp
@@ -25,7 +25,7 @@ class AuthChallengeSerializerTest : public CppUnit::TestFixture {
boost::shared_ptr<AuthChallenge> authChallenge(new AuthChallenge());
authChallenge->setValue("foo");
- CPPUNIT_ASSERT_EQUAL(String(
+ CPPUNIT_ASSERT_EQUAL(std::string(
"<challenge xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">"
"Zm9v"
"</challenge>"), testling.serialize(authChallenge));
@@ -35,7 +35,7 @@ class AuthChallengeSerializerTest : public CppUnit::TestFixture {
AuthChallengeSerializer testling;
boost::shared_ptr<AuthChallenge> authChallenge(new AuthChallenge());
- CPPUNIT_ASSERT_EQUAL(String(
+ CPPUNIT_ASSERT_EQUAL(std::string(
"<challenge xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">"
"</challenge>"), testling.serialize(authChallenge));
}
@@ -45,7 +45,7 @@ class AuthChallengeSerializerTest : public CppUnit::TestFixture {
boost::shared_ptr<AuthChallenge> authChallenge(new AuthChallenge());
authChallenge->setValue(ByteArray());
- CPPUNIT_ASSERT_EQUAL(String(
+ CPPUNIT_ASSERT_EQUAL(std::string(
"<challenge xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">"
"="
"</challenge>"), testling.serialize(authChallenge));
diff --git a/Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp b/Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp
index f63db90..9f9f2fa 100644
--- a/Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp
+++ b/Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp
@@ -25,7 +25,7 @@ class AuthRequestSerializerTest : public CppUnit::TestFixture {
boost::shared_ptr<AuthRequest> authRequest(new AuthRequest("PLAIN"));
authRequest->setMessage("foo");
- CPPUNIT_ASSERT_EQUAL(String(
+ CPPUNIT_ASSERT_EQUAL(std::string(
"<auth xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\" mechanism=\"PLAIN\">"
"Zm9v"
"</auth>"), testling.serialize(authRequest));
@@ -35,7 +35,7 @@ class AuthRequestSerializerTest : public CppUnit::TestFixture {
AuthRequestSerializer testling;
boost::shared_ptr<AuthRequest> authRequest(new AuthRequest("PLAIN"));
- CPPUNIT_ASSERT_EQUAL(String(
+ CPPUNIT_ASSERT_EQUAL(std::string(
"<auth xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\" mechanism=\"PLAIN\">"
"</auth>"), testling.serialize(authRequest));
}
@@ -45,7 +45,7 @@ class AuthRequestSerializerTest : public CppUnit::TestFixture {
boost::shared_ptr<AuthRequest> authRequest(new AuthRequest("PLAIN"));
authRequest->setMessage(ByteArray());
- CPPUNIT_ASSERT_EQUAL(String(
+ CPPUNIT_ASSERT_EQUAL(std::string(
"<auth xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\" mechanism=\"PLAIN\">"
"="
"</auth>"), testling.serialize(authRequest));
diff --git a/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp b/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp
index fabe834..c93810c 100644
--- a/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp
+++ b/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp
@@ -25,7 +25,7 @@ class AuthResponseSerializerTest : public CppUnit::TestFixture {
boost::shared_ptr<AuthResponse> authResponse(new AuthResponse());
authResponse->setValue("foo");
- CPPUNIT_ASSERT_EQUAL(String(
+ CPPUNIT_ASSERT_EQUAL(std::string(
"<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">"
"Zm9v"
"</response>"), testling.serialize(authResponse));
@@ -35,7 +35,7 @@ class AuthResponseSerializerTest : public CppUnit::TestFixture {
AuthResponseSerializer testling;
boost::shared_ptr<AuthResponse> authResponse(new AuthResponse());
- CPPUNIT_ASSERT_EQUAL(String(
+ CPPUNIT_ASSERT_EQUAL(std::string(
"<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">"
"</response>"), testling.serialize(authResponse));
}
@@ -45,7 +45,7 @@ class AuthResponseSerializerTest : public CppUnit::TestFixture {
boost::shared_ptr<AuthResponse> authResponse(new AuthResponse());
authResponse->setValue(ByteArray());
- CPPUNIT_ASSERT_EQUAL(String(
+ CPPUNIT_ASSERT_EQUAL(std::string(
"<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">"
"="
"</response>"), testling.serialize(authResponse));
diff --git a/Swiften/Serializer/UnitTest/AuthSuccessSerializerTest.cpp b/Swiften/Serializer/UnitTest/AuthSuccessSerializerTest.cpp
index a9b602f..385c1e5 100644
--- a/Swiften/Serializer/UnitTest/AuthSuccessSerializerTest.cpp
+++ b/Swiften/Serializer/UnitTest/AuthSuccessSerializerTest.cpp
@@ -25,7 +25,7 @@ class AuthSuccessSerializerTest : public CppUnit::TestFixture {
boost::shared_ptr<AuthSuccess> authSuccess(new AuthSuccess());
authSuccess->setValue("foo");
- CPPUNIT_ASSERT_EQUAL(String(
+ CPPUNIT_ASSERT_EQUAL(std::string(
"<success xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">"
"Zm9v"
"</success>"), testling.serialize(authSuccess));
@@ -35,7 +35,7 @@ class AuthSuccessSerializerTest : public CppUnit::TestFixture {
AuthSuccessSerializer testling;
boost::shared_ptr<AuthSuccess> authSuccess(new AuthSuccess());
- CPPUNIT_ASSERT_EQUAL(String(
+ CPPUNIT_ASSERT_EQUAL(std::string(
"<success xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">"
"</success>"), testling.serialize(authSuccess));
}
@@ -45,7 +45,7 @@ class AuthSuccessSerializerTest : public CppUnit::TestFixture {
boost::shared_ptr<AuthSuccess> authSuccess(new AuthSuccess());
authSuccess->setValue(ByteArray());
- CPPUNIT_ASSERT_EQUAL(String(
+ CPPUNIT_ASSERT_EQUAL(std::string(
"<success xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">"
"="
"</success>"), testling.serialize(authSuccess));
diff --git a/Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp b/Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp
index bd39bd8..65caa81 100644
--- a/Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp
+++ b/Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp
@@ -33,7 +33,7 @@ class StreamFeaturesSerializerTest : public CppUnit::TestFixture
streamFeatures->setHasSession();
streamFeatures->setHasStreamManagement();
- CPPUNIT_ASSERT_EQUAL(String(
+ CPPUNIT_ASSERT_EQUAL(std::string(
"<stream:features>"
"<starttls xmlns=\"urn:ietf:params:xml:ns:xmpp-tls\"/>"
"<compression xmlns=\"http://jabber.org/features/compress\">"
diff --git a/Swiften/Serializer/UnitTest/XMPPSerializerTest.cpp b/Swiften/Serializer/UnitTest/XMPPSerializerTest.cpp
index 45ffe4b..76c1b23 100644
--- a/Swiften/Serializer/UnitTest/XMPPSerializerTest.cpp
+++ b/Swiften/Serializer/UnitTest/XMPPSerializerTest.cpp
@@ -38,7 +38,7 @@ class XMPPSerializerTest : public CppUnit::TestFixture {
protocolHeader.setID("myid");
protocolHeader.setVersion("0.99");
- CPPUNIT_ASSERT_EQUAL(String("<?xml version=\"1.0\"?><stream:stream xmlns=\"jabber:client\" xmlns:stream=\"http://etherx.jabber.org/streams\" from=\"bla@foo.com\" to=\"foo.com\" id=\"myid\" version=\"0.99\">"), testling->serializeHeader(protocolHeader));
+ CPPUNIT_ASSERT_EQUAL(std::string("<?xml version=\"1.0\"?><stream:stream xmlns=\"jabber:client\" xmlns:stream=\"http://etherx.jabber.org/streams\" from=\"bla@foo.com\" to=\"foo.com\" id=\"myid\" version=\"0.99\">"), testling->serializeHeader(protocolHeader));
}
void testSerializeHeader_Component() {
@@ -49,7 +49,7 @@ class XMPPSerializerTest : public CppUnit::TestFixture {
protocolHeader.setID("myid");
protocolHeader.setVersion("0.99");
- CPPUNIT_ASSERT_EQUAL(String("<?xml version=\"1.0\"?><stream:stream xmlns=\"jabber:component:accept\" xmlns:stream=\"http://etherx.jabber.org/streams\" from=\"bla@foo.com\" to=\"foo.com\" id=\"myid\" version=\"0.99\">"), testling->serializeHeader(protocolHeader));
+ CPPUNIT_ASSERT_EQUAL(std::string("<?xml version=\"1.0\"?><stream:stream xmlns=\"jabber:component:accept\" xmlns:stream=\"http://etherx.jabber.org/streams\" from=\"bla@foo.com\" to=\"foo.com\" id=\"myid\" version=\"0.99\">"), testling->serializeHeader(protocolHeader));
}
void testSerializeHeader_Server() {
@@ -60,7 +60,7 @@ class XMPPSerializerTest : public CppUnit::TestFixture {
protocolHeader.setID("myid");
protocolHeader.setVersion("0.99");
- CPPUNIT_ASSERT_EQUAL(String("<?xml version=\"1.0\"?><stream:stream xmlns=\"jabber:server\" xmlns:stream=\"http://etherx.jabber.org/streams\" from=\"bla@foo.com\" to=\"foo.com\" id=\"myid\" version=\"0.99\">"), testling->serializeHeader(protocolHeader));
+ CPPUNIT_ASSERT_EQUAL(std::string("<?xml version=\"1.0\"?><stream:stream xmlns=\"jabber:server\" xmlns:stream=\"http://etherx.jabber.org/streams\" from=\"bla@foo.com\" to=\"foo.com\" id=\"myid\" version=\"0.99\">"), testling->serializeHeader(protocolHeader));
}
private:
diff --git a/Swiften/Serializer/XML/UnitTest/XMLElementTest.cpp b/Swiften/Serializer/XML/UnitTest/XMLElementTest.cpp
index bfd91d1..8c68f97 100644
--- a/Swiften/Serializer/XML/UnitTest/XMLElementTest.cpp
+++ b/Swiften/Serializer/XML/UnitTest/XMLElementTest.cpp
@@ -34,8 +34,8 @@ class XMLElementTest : public CppUnit::TestFixture
bazElement->addNode(boost::shared_ptr<XMLTextNode>(new XMLTextNode("Bli")));
testling.addNode(bazElement);
- String result = testling.serialize();
- String expectedResult =
+ std::string result = testling.serialize();
+ std::string expectedResult =
"<foo myatt=\"myval\" xmlns=\"http://example.com\">"
"<bar>Blo</bar>"
"<baz>Bli</baz>"
@@ -47,21 +47,21 @@ class XMLElementTest : public CppUnit::TestFixture
void testSerialize_NoChildren() {
XMLElement testling("foo", "http://example.com");
- CPPUNIT_ASSERT_EQUAL(String("<foo xmlns=\"http://example.com\"/>"), testling.serialize());
+ CPPUNIT_ASSERT_EQUAL(std::string("<foo xmlns=\"http://example.com\"/>"), testling.serialize());
}
void testSerialize_SpecialAttributeCharacters() {
XMLElement testling("foo");
testling.setAttribute("myatt", "<\"'&>");
- CPPUNIT_ASSERT_EQUAL(String("<foo myatt=\"&lt;&quot;&apos;&amp;&gt;\"/>"), testling.serialize());
+ CPPUNIT_ASSERT_EQUAL(std::string("<foo myatt=\"&lt;&quot;&apos;&amp;&gt;\"/>"), testling.serialize());
}
void testSerialize_EmptyAttributeValue() {
XMLElement testling("foo");
testling.setAttribute("myatt", "");
- CPPUNIT_ASSERT_EQUAL(String("<foo myatt=\"\"/>"), testling.serialize());
+ CPPUNIT_ASSERT_EQUAL(std::string("<foo myatt=\"\"/>"), testling.serialize());
}
};
diff --git a/Swiften/Serializer/XML/XMLElement.cpp b/Swiften/Serializer/XML/XMLElement.cpp
index 289ce31..6c90e0d 100644
--- a/Swiften/Serializer/XML/XMLElement.cpp
+++ b/Swiften/Serializer/XML/XMLElement.cpp
@@ -11,19 +11,19 @@
namespace Swift {
-XMLElement::XMLElement(const String& tag, const String& xmlns, const String& text) : tag_(tag) {
- if (!xmlns.isEmpty()) {
+XMLElement::XMLElement(const std::string& tag, const std::string& xmlns, const std::string& text) : tag_(tag) {
+ if (!xmlns.empty()) {
setAttribute("xmlns", xmlns);
}
- if (!text.isEmpty()) {
+ if (!text.empty()) {
addNode(XMLTextNode::ref(new XMLTextNode(text)));
}
}
-String XMLElement::serialize() {
- String result;
+std::string XMLElement::serialize() {
+ std::string result;
result += "<" + tag_;
- typedef std::pair<String,String> Pair;
+ typedef std::pair<std::string,std::string> Pair;
foreach(const Pair& p, attributes_) {
result += " " + p.first + "=\"" + p.second + "\"";
}
@@ -41,13 +41,13 @@ String XMLElement::serialize() {
return result;
}
-void XMLElement::setAttribute(const String& attribute, const String& value) {
- String escapedValue(value);
- escapedValue.replaceAll('&', "&amp;");
- escapedValue.replaceAll('<', "&lt;");
- escapedValue.replaceAll('>', "&gt;");
- escapedValue.replaceAll('\'', "&apos;");
- escapedValue.replaceAll('"', "&quot;");
+void XMLElement::setAttribute(const std::string& attribute, const std::string& value) {
+ std::string escapedValue(value);
+ String::replaceAll(escapedValue, '&', "&amp;");
+ String::replaceAll(escapedValue, '<', "&lt;");
+ String::replaceAll(escapedValue, '>', "&gt;");
+ String::replaceAll(escapedValue, '\'', "&apos;");
+ String::replaceAll(escapedValue, '"', "&quot;");
attributes_[attribute] = escapedValue;
}
diff --git a/Swiften/Serializer/XML/XMLElement.h b/Swiften/Serializer/XML/XMLElement.h
index b350344..65af7ae 100644
--- a/Swiften/Serializer/XML/XMLElement.h
+++ b/Swiften/Serializer/XML/XMLElement.h
@@ -10,7 +10,7 @@
#include <vector>
#include <map>
-#include "Swiften/Base/String.h"
+#include <string>
#include "Swiften/Serializer/XML/XMLNode.h"
@@ -19,16 +19,16 @@ namespace Swift {
public:
typedef boost::shared_ptr<XMLElement> ref;
- XMLElement(const String& tag, const String& xmlns = "", const String& text = "");
+ XMLElement(const std::string& tag, const std::string& xmlns = "", const std::string& text = "");
- void setAttribute(const String& attribute, const String& value);
+ void setAttribute(const std::string& attribute, const std::string& value);
void addNode(boost::shared_ptr<XMLNode> node);
- virtual String serialize();
+ virtual std::string serialize();
private:
- String tag_;
- std::map<String, String> attributes_;
+ std::string tag_;
+ std::map<std::string, std::string> attributes_;
std::vector< boost::shared_ptr<XMLNode> > childNodes_;
};
}
diff --git a/Swiften/Serializer/XML/XMLNode.h b/Swiften/Serializer/XML/XMLNode.h
index 6b75aa9..5261888 100644
--- a/Swiften/Serializer/XML/XMLNode.h
+++ b/Swiften/Serializer/XML/XMLNode.h
@@ -7,14 +7,14 @@
#ifndef SWIFTEN_XMLNode_H
#define SWIFTEN_XMLNode_H
-#include "Swiften/Base/String.h"
+#include <string>
namespace Swift {
class XMLNode {
public:
virtual ~XMLNode();
- virtual String serialize() = 0;
+ virtual std::string serialize() = 0;
};
}
diff --git a/Swiften/Serializer/XML/XMLRawTextNode.h b/Swiften/Serializer/XML/XMLRawTextNode.h
index 1f9f8ec..9fa8c40 100644
--- a/Swiften/Serializer/XML/XMLRawTextNode.h
+++ b/Swiften/Serializer/XML/XMLRawTextNode.h
@@ -12,15 +12,15 @@
namespace Swift {
class XMLRawTextNode : public XMLNode {
public:
- XMLRawTextNode(const String& text) : text_(text) {
+ XMLRawTextNode(const std::string& text) : text_(text) {
}
- String serialize() {
+ std::string serialize() {
return text_;
}
private:
- String text_;
+ std::string text_;
};
}
diff --git a/Swiften/Serializer/XML/XMLTextNode.h b/Swiften/Serializer/XML/XMLTextNode.h
index dae4d58..4d55f76 100644
--- a/Swiften/Serializer/XML/XMLTextNode.h
+++ b/Swiften/Serializer/XML/XMLTextNode.h
@@ -7,28 +7,28 @@
#pragma once
#include "Swiften/Serializer/XML/XMLNode.h"
-
+#include <Swiften/Base/String.h>
namespace Swift {
class XMLTextNode : public XMLNode {
public:
typedef boost::shared_ptr<XMLTextNode> ref;
- XMLTextNode(const String& text) : text_(text) {
- text_.replaceAll('&', "&amp;"); // Should come first
- text_.replaceAll('<', "&lt;");
- text_.replaceAll('>', "&gt;");
+ XMLTextNode(const std::string& text) : text_(text) {
+ String::replaceAll(text_, '&', "&amp;"); // Should come first
+ String::replaceAll(text_, '<', "&lt;");
+ String::replaceAll(text_, '>', "&gt;");
}
- String serialize() {
+ std::string serialize() {
return text_;
}
- static ref create(const String& text) {
+ static ref create(const std::string& text) {
return ref(new XMLTextNode(text));
}
private:
- String text_;
+ std::string text_;
};
}
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";
diff --git a/Swiften/Serializer/XMPPSerializer.h b/Swiften/Serializer/XMPPSerializer.h
index 13c2cf7..4f83857 100644
--- a/Swiften/Serializer/XMPPSerializer.h
+++ b/Swiften/Serializer/XMPPSerializer.h
@@ -11,7 +11,7 @@
#include "Swiften/Elements/Element.h"
#include "Swiften/Elements/StreamType.h"
-#include "Swiften/Base/String.h"
+#include <string>
#include "Swiften/Serializer/ElementSerializer.h"
namespace Swift {
@@ -23,12 +23,12 @@ namespace Swift {
public:
XMPPSerializer(PayloadSerializerCollection*, StreamType type);
- String serializeHeader(const ProtocolHeader&) const;
- String serializeElement(boost::shared_ptr<Element> stanza) const;
- String serializeFooter() const;
+ std::string serializeHeader(const ProtocolHeader&) const;
+ std::string serializeElement(boost::shared_ptr<Element> stanza) const;
+ std::string serializeFooter() const;
private:
- String getDefaultNamespace() const;
+ std::string getDefaultNamespace() const;
private:
StreamType type_;