summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Parser/PayloadParsers')
-rw-r--r--Swiften/Parser/PayloadParsers/BodyParser.cpp2
-rw-r--r--Swiften/Parser/PayloadParsers/BodyParser.h9
-rw-r--r--Swiften/Parser/PayloadParsers/BytestreamsParser.cpp6
-rw-r--r--Swiften/Parser/PayloadParsers/BytestreamsParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/BytestreamsParserFactory.h4
-rw-r--r--Swiften/Parser/PayloadParsers/CapsInfoParser.cpp2
-rw-r--r--Swiften/Parser/PayloadParsers/CapsInfoParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/ChatStateParser.cpp2
-rw-r--r--Swiften/Parser/PayloadParsers/ChatStateParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/ChatStateParserFactory.h4
-rw-r--r--Swiften/Parser/PayloadParsers/CommandParser.cpp6
-rw-r--r--Swiften/Parser/PayloadParsers/CommandParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/CommandParserFactory.h4
-rw-r--r--Swiften/Parser/PayloadParsers/DelayParser.cpp3
-rw-r--r--Swiften/Parser/PayloadParsers/DelayParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/DelayParserFactory.cpp1
-rw-r--r--Swiften/Parser/PayloadParsers/DelayParserFactory.h4
-rw-r--r--Swiften/Parser/PayloadParsers/DiscoInfoParser.cpp6
-rw-r--r--Swiften/Parser/PayloadParsers/DiscoInfoParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/DiscoItemsParser.cpp2
-rw-r--r--Swiften/Parser/PayloadParsers/DiscoItemsParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/ErrorParser.cpp54
-rw-r--r--Swiften/Parser/PayloadParsers/ErrorParser.h14
-rw-r--r--Swiften/Parser/PayloadParsers/ErrorParserFactory.h32
-rw-r--r--Swiften/Parser/PayloadParsers/FormParser.cpp7
-rw-r--r--Swiften/Parser/PayloadParsers/FormParser.h5
-rw-r--r--Swiften/Parser/PayloadParsers/FormParserFactory.h4
-rw-r--r--Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.cpp79
-rw-r--r--Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h4
-rw-r--r--Swiften/Parser/PayloadParsers/IBBParser.cpp10
-rw-r--r--Swiften/Parser/PayloadParsers/IBBParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParser.cpp6
-rw-r--r--Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParserFactory.h4
-rw-r--r--Swiften/Parser/PayloadParsers/LastParser.cpp36
-rw-r--r--Swiften/Parser/PayloadParsers/LastParser.h24
-rw-r--r--Swiften/Parser/PayloadParsers/MUCUserPayloadParser.cpp4
-rw-r--r--Swiften/Parser/PayloadParsers/MUCUserPayloadParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/MUCUserPayloadParserFactory.h4
-rw-r--r--Swiften/Parser/PayloadParsers/NicknameParser.cpp2
-rw-r--r--Swiften/Parser/PayloadParsers/NicknameParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/NicknameParserFactory.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PriorityParser.cpp4
-rw-r--r--Swiften/Parser/PayloadParsers/PriorityParser.h9
-rw-r--r--Swiften/Parser/PayloadParsers/PrivateStorageParser.cpp6
-rw-r--r--Swiften/Parser/PayloadParsers/PrivateStorageParser.h6
-rw-r--r--Swiften/Parser/PayloadParsers/PrivateStorageParserFactory.h4
-rw-r--r--Swiften/Parser/PayloadParsers/RawXMLPayloadParser.cpp4
-rw-r--r--Swiften/Parser/PayloadParsers/RawXMLPayloadParser.h6
-rw-r--r--Swiften/Parser/PayloadParsers/RawXMLPayloadParserFactory.h4
-rw-r--r--Swiften/Parser/PayloadParsers/ReplaceParser.cpp29
-rw-r--r--Swiften/Parser/PayloadParsers/ReplaceParser.h23
-rw-r--r--Swiften/Parser/PayloadParsers/ResourceBindParser.cpp2
-rw-r--r--Swiften/Parser/PayloadParsers/ResourceBindParser.h9
-rw-r--r--Swiften/Parser/PayloadParsers/RosterItemExchangeParser.cpp68
-rw-r--r--Swiften/Parser/PayloadParsers/RosterItemExchangeParser.h34
-rw-r--r--Swiften/Parser/PayloadParsers/RosterParser.cpp15
-rw-r--r--Swiften/Parser/PayloadParsers/RosterParser.h9
-rw-r--r--Swiften/Parser/PayloadParsers/SearchPayloadParser.cpp6
-rw-r--r--Swiften/Parser/PayloadParsers/SearchPayloadParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/SearchPayloadParserFactory.h4
-rw-r--r--Swiften/Parser/PayloadParsers/SecurityLabelParser.cpp4
-rw-r--r--Swiften/Parser/PayloadParsers/SecurityLabelParser.h9
-rw-r--r--Swiften/Parser/PayloadParsers/SecurityLabelParserFactory.h9
-rw-r--r--Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.cpp6
-rw-r--r--Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.h9
-rw-r--r--Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParserFactory.h9
-rw-r--r--Swiften/Parser/PayloadParsers/SoftwareVersionParser.cpp2
-rw-r--r--Swiften/Parser/PayloadParsers/SoftwareVersionParser.h9
-rw-r--r--Swiften/Parser/PayloadParsers/StartSessionParser.h9
-rw-r--r--Swiften/Parser/PayloadParsers/StatusParser.cpp2
-rw-r--r--Swiften/Parser/PayloadParsers/StatusParser.h9
-rw-r--r--Swiften/Parser/PayloadParsers/StatusShowParser.cpp2
-rw-r--r--Swiften/Parser/PayloadParsers/StatusShowParser.h9
-rw-r--r--Swiften/Parser/PayloadParsers/StorageParser.cpp2
-rw-r--r--Swiften/Parser/PayloadParsers/StorageParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/StreamInitiationParser.cpp10
-rw-r--r--Swiften/Parser/PayloadParsers/StreamInitiationParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/StreamInitiationParserFactory.h4
-rw-r--r--Swiften/Parser/PayloadParsers/SubjectParser.cpp2
-rw-r--r--Swiften/Parser/PayloadParsers/SubjectParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/BodyParserTest.cpp4
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/CommandParserTest.cpp4
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/DiscoInfoParserTest.cpp4
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/ErrorParserTest.cpp25
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/FormParserTest.cpp8
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/IBBParserTest.cpp8
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/PayloadParserTester.h4
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h14
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/PriorityParserTest.cpp8
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/PrivateStorageParserTest.cpp8
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/RawXMLPayloadParserTest.cpp4
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/ReplaceTest.cpp36
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/ResourceBindParserTest.cpp4
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/RosterItemExchangeParserTest.cpp52
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/RosterParserTest.cpp26
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/SearchPayloadParserTest.cpp4
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/SecurityLabelParserTest.cpp4
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/SecurityLabelsCatalogParserTest.cpp4
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/SoftwareVersionParserTest.cpp4
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/StatusParserTest.cpp4
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/StatusShowParserTest.cpp4
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/StorageParserTest.cpp4
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/StreamInitiationParserTest.cpp4
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/VCardParserTest.cpp9
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/VCardUpdateParserTest.cpp4
-rw-r--r--Swiften/Parser/PayloadParsers/VCardParser.cpp8
-rw-r--r--Swiften/Parser/PayloadParsers/VCardParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/VCardParserFactory.h4
-rw-r--r--Swiften/Parser/PayloadParsers/VCardUpdateParser.cpp2
-rw-r--r--Swiften/Parser/PayloadParsers/VCardUpdateParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/VCardUpdateParserFactory.h4
112 files changed, 710 insertions, 326 deletions
diff --git a/Swiften/Parser/PayloadParsers/BodyParser.cpp b/Swiften/Parser/PayloadParsers/BodyParser.cpp
index d0f4e09..ac8bdd5 100644
--- a/Swiften/Parser/PayloadParsers/BodyParser.cpp
+++ b/Swiften/Parser/PayloadParsers/BodyParser.cpp
@@ -4,7 +4,7 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/BodyParser.h"
+#include <Swiften/Parser/PayloadParsers/BodyParser.h>
namespace Swift {
diff --git a/Swiften/Parser/PayloadParsers/BodyParser.h b/Swiften/Parser/PayloadParsers/BodyParser.h
index f9e17e0..f571370 100644
--- a/Swiften/Parser/PayloadParsers/BodyParser.h
+++ b/Swiften/Parser/PayloadParsers/BodyParser.h
@@ -4,11 +4,10 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#ifndef SWIFTEN_BodyParser_H
-#define SWIFTEN_BodyParser_H
+#pragma once
-#include "Swiften/Elements/Body.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
+#include <Swiften/Elements/Body.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
class BodyParser : public GenericPayloadParser<Body> {
@@ -24,5 +23,3 @@ namespace Swift {
std::string text_;
};
}
-
-#endif
diff --git a/Swiften/Parser/PayloadParsers/BytestreamsParser.cpp b/Swiften/Parser/PayloadParsers/BytestreamsParser.cpp
index 35db9ec..fddc1c7 100644
--- a/Swiften/Parser/PayloadParsers/BytestreamsParser.cpp
+++ b/Swiften/Parser/PayloadParsers/BytestreamsParser.cpp
@@ -4,11 +4,11 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/BytestreamsParser.h"
+#include <Swiften/Parser/PayloadParsers/BytestreamsParser.h>
#include <boost/lexical_cast.hpp>
-#include "Swiften/Base/foreach.h"
+#include <Swiften/Base/foreach.h>
namespace Swift {
@@ -27,7 +27,7 @@ void BytestreamsParser::handleStartElement(const std::string& element, const std
try {
getPayloadInternal()->addStreamHost(Bytestreams::StreamHost(attributes.getAttribute("host"), JID(attributes.getAttribute("jid")), boost::lexical_cast<int>(attributes.getAttribute("port"))));
}
- catch (boost::bad_lexical_cast& e) {
+ catch (boost::bad_lexical_cast&) {
}
}
else if (element == "streamhost-used") {
diff --git a/Swiften/Parser/PayloadParsers/BytestreamsParser.h b/Swiften/Parser/PayloadParsers/BytestreamsParser.h
index 2d67785..4785913 100644
--- a/Swiften/Parser/PayloadParsers/BytestreamsParser.h
+++ b/Swiften/Parser/PayloadParsers/BytestreamsParser.h
@@ -8,8 +8,8 @@
#include <boost/optional.hpp>
-#include "Swiften/Elements/Bytestreams.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
+#include <Swiften/Elements/Bytestreams.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
class BytestreamsParser : public GenericPayloadParser<Bytestreams> {
diff --git a/Swiften/Parser/PayloadParsers/BytestreamsParserFactory.h b/Swiften/Parser/PayloadParsers/BytestreamsParserFactory.h
index 8defd45..06ebc4d 100644
--- a/Swiften/Parser/PayloadParsers/BytestreamsParserFactory.h
+++ b/Swiften/Parser/PayloadParsers/BytestreamsParserFactory.h
@@ -6,8 +6,8 @@
#pragma once
-#include "Swiften/Parser/GenericPayloadParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/BytestreamsParser.h"
+#include <Swiften/Parser/GenericPayloadParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/BytestreamsParser.h>
namespace Swift {
class BytestreamsParserFactory : public GenericPayloadParserFactory<BytestreamsParser> {
diff --git a/Swiften/Parser/PayloadParsers/CapsInfoParser.cpp b/Swiften/Parser/PayloadParsers/CapsInfoParser.cpp
index d7d9324..770d98b 100644
--- a/Swiften/Parser/PayloadParsers/CapsInfoParser.cpp
+++ b/Swiften/Parser/PayloadParsers/CapsInfoParser.cpp
@@ -4,7 +4,7 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/CapsInfoParser.h"
+#include <Swiften/Parser/PayloadParsers/CapsInfoParser.h>
#include <locale>
diff --git a/Swiften/Parser/PayloadParsers/CapsInfoParser.h b/Swiften/Parser/PayloadParsers/CapsInfoParser.h
index 590326d..96aa734 100644
--- a/Swiften/Parser/PayloadParsers/CapsInfoParser.h
+++ b/Swiften/Parser/PayloadParsers/CapsInfoParser.h
@@ -6,8 +6,8 @@
#pragma once
-#include "Swiften/Elements/CapsInfo.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
+#include <Swiften/Elements/CapsInfo.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
class CapsInfoParser : public GenericPayloadParser<CapsInfo> {
diff --git a/Swiften/Parser/PayloadParsers/ChatStateParser.cpp b/Swiften/Parser/PayloadParsers/ChatStateParser.cpp
index 3a5ba3b..a85dcf7 100644
--- a/Swiften/Parser/PayloadParsers/ChatStateParser.cpp
+++ b/Swiften/Parser/PayloadParsers/ChatStateParser.cpp
@@ -4,7 +4,7 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/ChatStateParser.h"
+#include <Swiften/Parser/PayloadParsers/ChatStateParser.h>
namespace Swift {
diff --git a/Swiften/Parser/PayloadParsers/ChatStateParser.h b/Swiften/Parser/PayloadParsers/ChatStateParser.h
index 8d0e7f5..4363d6b 100644
--- a/Swiften/Parser/PayloadParsers/ChatStateParser.h
+++ b/Swiften/Parser/PayloadParsers/ChatStateParser.h
@@ -6,8 +6,8 @@
#pragma once
-#include "Swiften/Elements/ChatState.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
+#include <Swiften/Elements/ChatState.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
class ChatStateParser : public GenericPayloadParser<ChatState> {
diff --git a/Swiften/Parser/PayloadParsers/ChatStateParserFactory.h b/Swiften/Parser/PayloadParsers/ChatStateParserFactory.h
index 3dadda7..80d76c4 100644
--- a/Swiften/Parser/PayloadParsers/ChatStateParserFactory.h
+++ b/Swiften/Parser/PayloadParsers/ChatStateParserFactory.h
@@ -6,8 +6,8 @@
#pragma once
-#include "Swiften/Parser/PayloadParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/ChatStateParser.h"
+#include <Swiften/Parser/PayloadParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/ChatStateParser.h>
namespace Swift {
class PayloadParserFactoryCollection;
diff --git a/Swiften/Parser/PayloadParsers/CommandParser.cpp b/Swiften/Parser/PayloadParsers/CommandParser.cpp
index 3ebab39..1af4074 100644
--- a/Swiften/Parser/PayloadParsers/CommandParser.cpp
+++ b/Swiften/Parser/PayloadParsers/CommandParser.cpp
@@ -4,12 +4,12 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/CommandParser.h"
+#include <Swiften/Parser/PayloadParsers/CommandParser.h>
#include <boost/cast.hpp>
-#include "Swiften/Parser/PayloadParsers/FormParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/FormParser.h"
+#include <Swiften/Parser/PayloadParsers/FormParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/FormParser.h>
namespace Swift {
diff --git a/Swiften/Parser/PayloadParsers/CommandParser.h b/Swiften/Parser/PayloadParsers/CommandParser.h
index 0415ba6..80cffc4 100644
--- a/Swiften/Parser/PayloadParsers/CommandParser.h
+++ b/Swiften/Parser/PayloadParsers/CommandParser.h
@@ -8,8 +8,8 @@
#include <boost/optional.hpp>
-#include "Swiften/Elements/Command.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
+#include <Swiften/Elements/Command.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
class FormParserFactory;
diff --git a/Swiften/Parser/PayloadParsers/CommandParserFactory.h b/Swiften/Parser/PayloadParsers/CommandParserFactory.h
index 9eaaf62..47d3333 100644
--- a/Swiften/Parser/PayloadParsers/CommandParserFactory.h
+++ b/Swiften/Parser/PayloadParsers/CommandParserFactory.h
@@ -6,8 +6,8 @@
#pragma once
-#include "Swiften/Parser/PayloadParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/CommandParser.h"
+#include <Swiften/Parser/PayloadParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/CommandParser.h>
namespace Swift {
class PayloadParserFactoryCollection;
diff --git a/Swiften/Parser/PayloadParsers/DelayParser.cpp b/Swiften/Parser/PayloadParsers/DelayParser.cpp
index 3425b84..e2a6bad 100644
--- a/Swiften/Parser/PayloadParsers/DelayParser.cpp
+++ b/Swiften/Parser/PayloadParsers/DelayParser.cpp
@@ -4,11 +4,12 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/DelayParser.h"
+#include <Swiften/Parser/PayloadParsers/DelayParser.h>
#include <locale>
#include <boost/date_time/time_facet.hpp>
+#include <boost/date_time/posix_time/posix_time.hpp>
namespace Swift {
diff --git a/Swiften/Parser/PayloadParsers/DelayParser.h b/Swiften/Parser/PayloadParsers/DelayParser.h
index c2e2bb6..02103d9 100644
--- a/Swiften/Parser/PayloadParsers/DelayParser.h
+++ b/Swiften/Parser/PayloadParsers/DelayParser.h
@@ -6,8 +6,8 @@
#pragma once
-#include "Swiften/Elements/Delay.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
+#include <Swiften/Elements/Delay.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
class DelayParser : public GenericPayloadParser<Delay> {
diff --git a/Swiften/Parser/PayloadParsers/DelayParserFactory.cpp b/Swiften/Parser/PayloadParsers/DelayParserFactory.cpp
index 19d0530..48841d2 100644
--- a/Swiften/Parser/PayloadParsers/DelayParserFactory.cpp
+++ b/Swiften/Parser/PayloadParsers/DelayParserFactory.cpp
@@ -6,6 +6,7 @@
#include <Swiften/Parser/PayloadParsers/DelayParserFactory.h>
+#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/time_facet.hpp>
namespace Swift {
diff --git a/Swiften/Parser/PayloadParsers/DelayParserFactory.h b/Swiften/Parser/PayloadParsers/DelayParserFactory.h
index c150853..7dde35e 100644
--- a/Swiften/Parser/PayloadParsers/DelayParserFactory.h
+++ b/Swiften/Parser/PayloadParsers/DelayParserFactory.h
@@ -6,8 +6,8 @@
#pragma once
-#include "Swiften/Parser/PayloadParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/DelayParser.h"
+#include <Swiften/Parser/PayloadParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/DelayParser.h>
namespace Swift {
class PayloadParserFactoryCollection;
diff --git a/Swiften/Parser/PayloadParsers/DiscoInfoParser.cpp b/Swiften/Parser/PayloadParsers/DiscoInfoParser.cpp
index e1fcb20..14ff79d 100644
--- a/Swiften/Parser/PayloadParsers/DiscoInfoParser.cpp
+++ b/Swiften/Parser/PayloadParsers/DiscoInfoParser.cpp
@@ -4,8 +4,8 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/DiscoInfoParser.h"
-#include "Swiften/Parser/PayloadParsers/FormParser.h"
+#include <Swiften/Parser/PayloadParsers/DiscoInfoParser.h>
+#include <Swiften/Parser/PayloadParsers/FormParser.h>
namespace Swift {
@@ -15,7 +15,7 @@ DiscoInfoParser::DiscoInfoParser() : level_(TopLevel), formParser_(NULL) {
void DiscoInfoParser::handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) {
if (level_ == PayloadLevel) {
if (element == "identity") {
- getPayloadInternal()->addIdentity(DiscoInfo::Identity(attributes.getAttribute("name"), attributes.getAttribute("category"), attributes.getAttribute("type"), attributes.getAttribute("lang")));
+ getPayloadInternal()->addIdentity(DiscoInfo::Identity(attributes.getAttribute("name"), attributes.getAttribute("category"), attributes.getAttribute("type"), attributes.getAttribute("lang", "http://www.w3.org/XML/1998/namespace")));
}
else if (element == "feature") {
getPayloadInternal()->addFeature(attributes.getAttribute("var"));
diff --git a/Swiften/Parser/PayloadParsers/DiscoInfoParser.h b/Swiften/Parser/PayloadParsers/DiscoInfoParser.h
index 24a1d6f..df1441c 100644
--- a/Swiften/Parser/PayloadParsers/DiscoInfoParser.h
+++ b/Swiften/Parser/PayloadParsers/DiscoInfoParser.h
@@ -6,8 +6,8 @@
#pragma once
-#include "Swiften/Elements/DiscoInfo.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
+#include <Swiften/Elements/DiscoInfo.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
class DiscoInfoParser : public GenericPayloadParser<DiscoInfo> {
diff --git a/Swiften/Parser/PayloadParsers/DiscoItemsParser.cpp b/Swiften/Parser/PayloadParsers/DiscoItemsParser.cpp
index 7ff375b..d6ac94d 100644
--- a/Swiften/Parser/PayloadParsers/DiscoItemsParser.cpp
+++ b/Swiften/Parser/PayloadParsers/DiscoItemsParser.cpp
@@ -4,7 +4,7 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/DiscoItemsParser.h"
+#include <Swiften/Parser/PayloadParsers/DiscoItemsParser.h>
namespace Swift {
diff --git a/Swiften/Parser/PayloadParsers/DiscoItemsParser.h b/Swiften/Parser/PayloadParsers/DiscoItemsParser.h
index 0700df6..ae799cb 100644
--- a/Swiften/Parser/PayloadParsers/DiscoItemsParser.h
+++ b/Swiften/Parser/PayloadParsers/DiscoItemsParser.h
@@ -6,8 +6,8 @@
#pragma once
-#include "Swiften/Elements/DiscoItems.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
+#include <Swiften/Elements/DiscoItems.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
class DiscoItemsParser : public GenericPayloadParser<DiscoItems> {
diff --git a/Swiften/Parser/PayloadParsers/ErrorParser.cpp b/Swiften/Parser/PayloadParsers/ErrorParser.cpp
index 4034cb5..1b0094e 100644
--- a/Swiften/Parser/PayloadParsers/ErrorParser.cpp
+++ b/Swiften/Parser/PayloadParsers/ErrorParser.cpp
@@ -4,14 +4,16 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/ErrorParser.h"
+#include <Swiften/Parser/PayloadParsers/ErrorParser.h>
+#include <Swiften/Parser/PayloadParserFactoryCollection.h>
+#include <Swiften/Parser/PayloadParserFactory.h>
namespace Swift {
-ErrorParser::ErrorParser() : level_(TopLevel) {
+ErrorParser::ErrorParser(PayloadParserFactoryCollection* factories) : factories(factories), level_(TopLevel) {
}
-void ErrorParser::handleStartElement(const std::string&, const std::string&, const AttributeMap& attributes) {
+void ErrorParser::handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) {
if (level_ == TopLevel) {
std::string type = attributes.getAttribute("type");
if (type == "continue") {
@@ -30,14 +32,9 @@ void ErrorParser::handleStartElement(const std::string&, const std::string&, con
getPayloadInternal()->setType(ErrorPayload::Cancel);
}
}
- ++level_;
-}
-
-void ErrorParser::handleEndElement(const std::string& element, const std::string&) {
- --level_;
- if (level_ == PayloadLevel) {
+ else if (level_ == PayloadLevel) {
if (element == "text") {
- getPayloadInternal()->setText(currentText_);
+
}
else if (element == "bad-request") {
getPayloadInternal()->setCondition(ErrorPayload::BadRequest);
@@ -103,13 +100,46 @@ void ErrorParser::handleEndElement(const std::string& element, const std::string
getPayloadInternal()->setCondition(ErrorPayload::UnexpectedRequest);
}
else {
- getPayloadInternal()->setCondition(ErrorPayload::UndefinedCondition);
+ PayloadParserFactory* payloadParserFactory = factories->getPayloadParserFactory(element, ns, attributes);
+ if (payloadParserFactory) {
+ currentPayloadParser.reset(payloadParserFactory->createPayloadParser());
+ } else {
+ getPayloadInternal()->setCondition(ErrorPayload::UndefinedCondition);
+ }
+ }
+ }
+ if (level_ >= PayloadLevel && currentPayloadParser.get()) {
+ currentPayloadParser->handleStartElement(element, ns, attributes);
+ }
+ ++level_;
+}
+
+void ErrorParser::handleEndElement(const std::string& element, const std::string& ns) {
+ --level_;
+ if (currentPayloadParser.get()) {
+ if (level_ >= PayloadLevel) {
+ currentPayloadParser->handleEndElement(element, ns);
+ }
+
+ if (level_ == PayloadLevel) {
+ getPayloadInternal()->setPayload(currentPayloadParser->getPayload());
+ currentPayloadParser.reset();
+ }
+ }
+ else if (level_ == PayloadLevel) {
+ if (element == "text") {
+ getPayloadInternal()->setText(currentText_);
}
}
}
void ErrorParser::handleCharacterData(const std::string& data) {
- currentText_ += data;
+ if (level_ > PayloadLevel && currentPayloadParser.get()) {
+ currentPayloadParser->handleCharacterData(data);
+ }
+ else {
+ currentText_ += data;
+ }
}
}
diff --git a/Swiften/Parser/PayloadParsers/ErrorParser.h b/Swiften/Parser/PayloadParsers/ErrorParser.h
index 4318a8c..b2d05cf 100644
--- a/Swiften/Parser/PayloadParsers/ErrorParser.h
+++ b/Swiften/Parser/PayloadParsers/ErrorParser.h
@@ -4,16 +4,16 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#ifndef SWIFTEN_ErrorParser_H
-#define SWIFTEN_ErrorParser_H
+#pragma once
-#include "Swiften/Elements/ErrorPayload.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
+#include <Swiften/Elements/ErrorPayload.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
+ class PayloadParserFactoryCollection;
class ErrorParser : public GenericPayloadParser<ErrorPayload> {
public:
- ErrorParser();
+ ErrorParser(PayloadParserFactoryCollection* factories);
virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes);
virtual void handleEndElement(const std::string& element, const std::string&);
@@ -24,9 +24,9 @@ namespace Swift {
TopLevel = 0,
PayloadLevel = 1
};
+ PayloadParserFactoryCollection* factories;
int level_;
std::string currentText_;
+ boost::shared_ptr<PayloadParser> currentPayloadParser;
};
}
-
-#endif
diff --git a/Swiften/Parser/PayloadParsers/ErrorParserFactory.h b/Swiften/Parser/PayloadParsers/ErrorParserFactory.h
new file mode 100644
index 0000000..1463807
--- /dev/null
+++ b/Swiften/Parser/PayloadParsers/ErrorParserFactory.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2011 Kevin Smith
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#pragma once
+
+#include <Swiften/Parser/PayloadParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/ErrorParser.h>
+
+namespace Swift {
+ class PayloadParserFactoryCollection;
+
+ class ErrorParserFactory : public PayloadParserFactory {
+ public:
+ ErrorParserFactory(PayloadParserFactoryCollection* factories) : factories(factories) {
+ }
+
+ virtual bool canParse(const std::string& element, const std::string& /*ns*/, const AttributeMap&) const {
+ return element == "error";
+ }
+
+ virtual PayloadParser* createPayloadParser() {
+ return new ErrorParser(factories);
+ }
+
+ private:
+ PayloadParserFactoryCollection* factories;
+
+ };
+}
diff --git a/Swiften/Parser/PayloadParsers/FormParser.cpp b/Swiften/Parser/PayloadParsers/FormParser.cpp
index f8e02a4..3905302 100644
--- a/Swiften/Parser/PayloadParsers/FormParser.cpp
+++ b/Swiften/Parser/PayloadParsers/FormParser.cpp
@@ -4,7 +4,7 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/FormParser.h"
+#include <Swiften/Parser/PayloadParsers/FormParser.h>
namespace Swift {
@@ -63,12 +63,9 @@ void FormParser::handleStartElement(const std::string& element, const std::strin
else if (type == "text-private") {
currentFieldParseHelper_ = TextPrivateFormFieldParseHelper::create();
}
- else if (type == "text-single") {
+ else /*if (type == "text-single") || undefined */ {
currentFieldParseHelper_ = TextSingleFormFieldParseHelper::create();
}
- else {
- currentFieldParseHelper_ = UntypedFormFieldParseHelper::create();
- }
if (currentFieldParseHelper_) {
currentFieldParseHelper_->getField()->setName(attributes.getAttribute("var"));
currentFieldParseHelper_->getField()->setLabel(attributes.getAttribute("label"));
diff --git a/Swiften/Parser/PayloadParsers/FormParser.h b/Swiften/Parser/PayloadParsers/FormParser.h
index 90a3550..eae40a1 100644
--- a/Swiften/Parser/PayloadParsers/FormParser.h
+++ b/Swiften/Parser/PayloadParsers/FormParser.h
@@ -6,8 +6,8 @@
#pragma once
-#include "Swiften/Elements/Form.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
+#include <Swiften/Elements/Form.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
class FormParser : public GenericPayloadParser<Form> {
@@ -96,7 +96,6 @@ namespace Swift {
SWIFTEN_DECLARE_FORM_FIELD_PARSE_HELPER(JIDSingle, JID);
SWIFTEN_DECLARE_FORM_FIELD_PARSE_HELPER(JIDMulti, JIDList);
SWIFTEN_DECLARE_FORM_FIELD_PARSE_HELPER(ListMulti, StringList);
- SWIFTEN_DECLARE_FORM_FIELD_PARSE_HELPER(Untyped, StringList);
enum Level {
TopLevel = 0,
diff --git a/Swiften/Parser/PayloadParsers/FormParserFactory.h b/Swiften/Parser/PayloadParsers/FormParserFactory.h
index 7c095a7..9e1794a 100644
--- a/Swiften/Parser/PayloadParsers/FormParserFactory.h
+++ b/Swiften/Parser/PayloadParsers/FormParserFactory.h
@@ -6,8 +6,8 @@
#pragma once
-#include "Swiften/Parser/PayloadParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/FormParser.h"
+#include <Swiften/Parser/PayloadParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/FormParser.h>
namespace Swift {
class PayloadParserFactoryCollection;
diff --git a/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.cpp b/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.cpp
index e20c06d..88a7bb6 100644
--- a/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.cpp
+++ b/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.cpp
@@ -4,41 +4,45 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h"
-#include "Swiften/Base/foreach.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
-#include "Swiften/Parser/PayloadParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/ErrorParser.h"
-#include "Swiften/Parser/PayloadParsers/BodyParser.h"
-#include "Swiften/Parser/PayloadParsers/SubjectParser.h"
-#include "Swiften/Parser/PayloadParsers/ChatStateParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/PriorityParser.h"
-#include "Swiften/Parser/PayloadParsers/ResourceBindParser.h"
-#include "Swiften/Parser/PayloadParsers/StartSessionParser.h"
-#include "Swiften/Parser/PayloadParsers/StatusParser.h"
-#include "Swiften/Parser/PayloadParsers/StatusShowParser.h"
-#include "Swiften/Parser/PayloadParsers/RosterParser.h"
-#include "Swiften/Parser/PayloadParsers/SoftwareVersionParser.h"
-#include "Swiften/Parser/PayloadParsers/StorageParser.h"
-#include "Swiften/Parser/PayloadParsers/DiscoInfoParser.h"
-#include "Swiften/Parser/PayloadParsers/DiscoItemsParser.h"
-#include "Swiften/Parser/PayloadParsers/CapsInfoParser.h"
-#include "Swiften/Parser/PayloadParsers/SecurityLabelParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/FormParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/CommandParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/SearchPayloadParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/StreamInitiationParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/BytestreamsParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/IBBParser.h"
-#include "Swiften/Parser/PayloadParsers/VCardUpdateParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/VCardParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/RawXMLPayloadParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/PrivateStorageParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/DelayParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/MUCUserPayloadParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/NicknameParserFactory.h"
+#include <Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h>
+#include <Swiften/Base/foreach.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
+#include <Swiften/Parser/PayloadParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/ErrorParser.h>
+#include <Swiften/Parser/PayloadParsers/ErrorParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/BodyParser.h>
+#include <Swiften/Parser/PayloadParsers/SubjectParser.h>
+#include <Swiften/Parser/PayloadParsers/ChatStateParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/PriorityParser.h>
+#include <Swiften/Parser/PayloadParsers/ResourceBindParser.h>
+#include <Swiften/Parser/PayloadParsers/StartSessionParser.h>
+#include <Swiften/Parser/PayloadParsers/StatusParser.h>
+#include <Swiften/Parser/PayloadParsers/StatusShowParser.h>
+#include <Swiften/Parser/PayloadParsers/RosterItemExchangeParser.h>
+#include <Swiften/Parser/PayloadParsers/RosterParser.h>
+#include <Swiften/Parser/PayloadParsers/SoftwareVersionParser.h>
+#include <Swiften/Parser/PayloadParsers/StorageParser.h>
+#include <Swiften/Parser/PayloadParsers/DiscoInfoParser.h>
+#include <Swiften/Parser/PayloadParsers/DiscoItemsParser.h>
+#include <Swiften/Parser/PayloadParsers/CapsInfoParser.h>
+#include <Swiften/Parser/PayloadParsers/SecurityLabelParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/FormParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/CommandParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/SearchPayloadParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/StreamInitiationParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/BytestreamsParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/IBBParser.h>
+#include <Swiften/Parser/PayloadParsers/VCardUpdateParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/VCardParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/RawXMLPayloadParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/PrivateStorageParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/DelayParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/MUCUserPayloadParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/NicknameParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/ReplaceParser.h>
+#include <Swiften/Parser/PayloadParsers/LastParser.h>
using namespace boost;
@@ -48,12 +52,15 @@ FullPayloadParserFactoryCollection::FullPayloadParserFactoryCollection() {
factories_.push_back(shared_ptr<PayloadParserFactory>(new GenericPayloadParserFactory<IBBParser>("", "http://jabber.org/protocol/ibb")));
factories_.push_back(shared_ptr<PayloadParserFactory>(new GenericPayloadParserFactory<StatusShowParser>("show")));
factories_.push_back(shared_ptr<PayloadParserFactory>(new GenericPayloadParserFactory<StatusParser>("status")));
+ factories_.push_back(shared_ptr<PayloadParserFactory>(new GenericPayloadParserFactory<ReplaceParser>("replace", "http://swift.im/protocol/replace")));
+ factories_.push_back(shared_ptr<PayloadParserFactory>(new GenericPayloadParserFactory<LastParser>("query", "jabber:iq:last")));
factories_.push_back(shared_ptr<PayloadParserFactory>(new GenericPayloadParserFactory<BodyParser>("body")));
factories_.push_back(shared_ptr<PayloadParserFactory>(new GenericPayloadParserFactory<SubjectParser>("subject")));
factories_.push_back(shared_ptr<PayloadParserFactory>(new GenericPayloadParserFactory<PriorityParser>("priority")));
- factories_.push_back(shared_ptr<PayloadParserFactory>(new GenericPayloadParserFactory<ErrorParser>("error")));
+ factories_.push_back(shared_ptr<PayloadParserFactory>(new ErrorParserFactory(this)));
factories_.push_back(shared_ptr<PayloadParserFactory>(new GenericPayloadParserFactory<SoftwareVersionParser>("query", "jabber:iq:version")));
factories_.push_back(shared_ptr<PayloadParserFactory>(new GenericPayloadParserFactory<StorageParser>("storage", "storage:bookmarks")));
+ factories_.push_back(shared_ptr<PayloadParserFactory>(new GenericPayloadParserFactory<RosterItemExchangeParser>("x", "http://jabber.org/protocol/rosterx")));
factories_.push_back(shared_ptr<PayloadParserFactory>(new GenericPayloadParserFactory<RosterParser>("query", "jabber:iq:roster")));
factories_.push_back(shared_ptr<PayloadParserFactory>(new GenericPayloadParserFactory<DiscoInfoParser>("query", "http://jabber.org/protocol/disco#info")));
factories_.push_back(shared_ptr<PayloadParserFactory>(new GenericPayloadParserFactory<DiscoItemsParser>("query", "http://jabber.org/protocol/disco#items")));
diff --git a/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h b/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h
index f3883b0..46b692b 100644
--- a/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h
+++ b/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h
@@ -9,8 +9,8 @@
#include <boost/shared_ptr.hpp>
#include <vector>
-#include "Swiften/Parser/PayloadParserFactoryCollection.h"
-#include "Swiften/Parser/PayloadParserFactory.h"
+#include <Swiften/Parser/PayloadParserFactoryCollection.h>
+#include <Swiften/Parser/PayloadParserFactory.h>
namespace Swift {
class FullPayloadParserFactoryCollection : public PayloadParserFactoryCollection {
diff --git a/Swiften/Parser/PayloadParsers/IBBParser.cpp b/Swiften/Parser/PayloadParsers/IBBParser.cpp
index f36dc43..2705c75 100644
--- a/Swiften/Parser/PayloadParsers/IBBParser.cpp
+++ b/Swiften/Parser/PayloadParsers/IBBParser.cpp
@@ -4,12 +4,12 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/IBBParser.h"
+#include <Swiften/Parser/PayloadParsers/IBBParser.h>
#include <boost/lexical_cast.hpp>
-#include "Swiften/Base/foreach.h"
-#include "Swiften/StringCodecs/Base64.h"
+#include <Swiften/Base/foreach.h>
+#include <Swiften/StringCodecs/Base64.h>
namespace Swift {
@@ -27,7 +27,7 @@ void IBBParser::handleStartElement(const std::string& element, const std::string
try {
getPayloadInternal()->setSequenceNumber(boost::lexical_cast<int>(attributes.getAttribute("seq")));
}
- catch (boost::bad_lexical_cast& e) {
+ catch (boost::bad_lexical_cast&) {
}
}
else if (element == "open") {
@@ -42,7 +42,7 @@ void IBBParser::handleStartElement(const std::string& element, const std::string
try {
getPayloadInternal()->setBlockSize(boost::lexical_cast<int>(attributes.getAttribute("block-size")));
}
- catch (boost::bad_lexical_cast& e) {
+ catch (boost::bad_lexical_cast&) {
}
}
else if (element == "close") {
diff --git a/Swiften/Parser/PayloadParsers/IBBParser.h b/Swiften/Parser/PayloadParsers/IBBParser.h
index 132e79d..d899475 100644
--- a/Swiften/Parser/PayloadParsers/IBBParser.h
+++ b/Swiften/Parser/PayloadParsers/IBBParser.h
@@ -8,8 +8,8 @@
#include <boost/optional.hpp>
-#include "Swiften/Elements/IBB.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
+#include <Swiften/Elements/IBB.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
class IBBParser : public GenericPayloadParser<IBB> {
diff --git a/Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParser.cpp b/Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParser.cpp
index 56995d8..06759cb 100644
--- a/Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParser.cpp
+++ b/Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParser.cpp
@@ -4,12 +4,12 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParser.h"
+#include <Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParser.h>
#include <boost/cast.hpp>
-#include "Swiften/Parser/PayloadParsers/FormParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/FormParser.h"
+#include <Swiften/Parser/PayloadParsers/FormParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/FormParser.h>
namespace Swift {
diff --git a/Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParser.h b/Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParser.h
index c0209c4..ae8d36c 100644
--- a/Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParser.h
+++ b/Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParser.h
@@ -8,8 +8,8 @@
#include <boost/optional.hpp>
-#include "Swiften/Elements/InBandRegistrationPayload.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
+#include <Swiften/Elements/InBandRegistrationPayload.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
class FormParserFactory;
diff --git a/Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParserFactory.h b/Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParserFactory.h
index 0417174..2dff18f 100644
--- a/Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParserFactory.h
+++ b/Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParserFactory.h
@@ -6,8 +6,8 @@
#pragma once
-#include "Swiften/Parser/GenericPayloadParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParser.h"
+#include <Swiften/Parser/GenericPayloadParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParser.h>
namespace Swift {
class InBandRegistrationPayloadParserFactory : public GenericPayloadParserFactory<InBandRegistrationPayloadParser> {
diff --git a/Swiften/Parser/PayloadParsers/LastParser.cpp b/Swiften/Parser/PayloadParsers/LastParser.cpp
new file mode 100644
index 0000000..77ebba8
--- /dev/null
+++ b/Swiften/Parser/PayloadParsers/LastParser.cpp
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2011 Kevin Smith
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#include <Swiften/Parser/PayloadParsers/LastParser.h>
+
+#include <boost/lexical_cast.hpp>
+
+namespace Swift {
+
+LastParser::LastParser() : level_(0) {
+}
+
+void LastParser::handleStartElement(const std::string&, const std::string&, const AttributeMap& attributes) {
+ if (level_ == 0) {
+ int seconds = 0;
+ try {
+ seconds = boost::lexical_cast<int>(attributes.getAttribute("seconds"));
+ }
+ catch (boost::bad_lexical_cast&) {
+ }
+ getPayloadInternal()->setSeconds(seconds);
+ }
+ ++level_;
+
+}
+
+void LastParser::handleEndElement(const std::string&, const std::string&) {
+}
+
+void LastParser::handleCharacterData(const std::string&) {
+}
+
+}
diff --git a/Swiften/Parser/PayloadParsers/LastParser.h b/Swiften/Parser/PayloadParsers/LastParser.h
new file mode 100644
index 0000000..7c5c707
--- /dev/null
+++ b/Swiften/Parser/PayloadParsers/LastParser.h
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2011 Kevin Smith
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#pragma once
+
+#include <Swiften/Elements/Last.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
+
+namespace Swift {
+ class LastParser : public GenericPayloadParser<Last> {
+ public:
+ LastParser();
+
+ virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes);
+ virtual void handleEndElement(const std::string& element, const std::string&);
+ virtual void handleCharacterData(const std::string& data);
+
+ private:
+ int level_;
+ };
+}
diff --git a/Swiften/Parser/PayloadParsers/MUCUserPayloadParser.cpp b/Swiften/Parser/PayloadParsers/MUCUserPayloadParser.cpp
index ec9e200..bd81b88 100644
--- a/Swiften/Parser/PayloadParsers/MUCUserPayloadParser.cpp
+++ b/Swiften/Parser/PayloadParsers/MUCUserPayloadParser.cpp
@@ -4,11 +4,11 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/MUCUserPayloadParser.h"
+#include <Swiften/Parser/PayloadParsers/MUCUserPayloadParser.h>
#include <boost/lexical_cast.hpp>
-#include "Swiften/Elements/MUCOccupant.h"
+#include <Swiften/Elements/MUCOccupant.h>
#include <cassert>
#include <iostream>
diff --git a/Swiften/Parser/PayloadParsers/MUCUserPayloadParser.h b/Swiften/Parser/PayloadParsers/MUCUserPayloadParser.h
index 384f0cd..b819905 100644
--- a/Swiften/Parser/PayloadParsers/MUCUserPayloadParser.h
+++ b/Swiften/Parser/PayloadParsers/MUCUserPayloadParser.h
@@ -8,8 +8,8 @@
#include <boost/optional.hpp>
-#include "Swiften/Elements/MUCUserPayload.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
+#include <Swiften/Elements/MUCUserPayload.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
class MUCUserPayloadParser : public GenericPayloadParser<MUCUserPayload> {
diff --git a/Swiften/Parser/PayloadParsers/MUCUserPayloadParserFactory.h b/Swiften/Parser/PayloadParsers/MUCUserPayloadParserFactory.h
index 3946ece..e6c8863 100644
--- a/Swiften/Parser/PayloadParsers/MUCUserPayloadParserFactory.h
+++ b/Swiften/Parser/PayloadParsers/MUCUserPayloadParserFactory.h
@@ -6,8 +6,8 @@
#pragma once
-#include "Swiften/Parser/GenericPayloadParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/MUCUserPayloadParser.h"
+#include <Swiften/Parser/GenericPayloadParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/MUCUserPayloadParser.h>
namespace Swift {
class MUCUserPayloadParserFactory : public GenericPayloadParserFactory<MUCUserPayloadParser> {
diff --git a/Swiften/Parser/PayloadParsers/NicknameParser.cpp b/Swiften/Parser/PayloadParsers/NicknameParser.cpp
index cd7ec27..b647b4d 100644
--- a/Swiften/Parser/PayloadParsers/NicknameParser.cpp
+++ b/Swiften/Parser/PayloadParsers/NicknameParser.cpp
@@ -4,7 +4,7 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/NicknameParser.h"
+#include <Swiften/Parser/PayloadParsers/NicknameParser.h>
namespace Swift {
diff --git a/Swiften/Parser/PayloadParsers/NicknameParser.h b/Swiften/Parser/PayloadParsers/NicknameParser.h
index 6e723c8..a89f835 100644
--- a/Swiften/Parser/PayloadParsers/NicknameParser.h
+++ b/Swiften/Parser/PayloadParsers/NicknameParser.h
@@ -6,8 +6,8 @@
#pragma once
-#include "Swiften/Elements/Nickname.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
+#include <Swiften/Elements/Nickname.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
class NicknameParser : public GenericPayloadParser<Nickname> {
diff --git a/Swiften/Parser/PayloadParsers/NicknameParserFactory.h b/Swiften/Parser/PayloadParsers/NicknameParserFactory.h
index ce2ebdd..b292513 100644
--- a/Swiften/Parser/PayloadParsers/NicknameParserFactory.h
+++ b/Swiften/Parser/PayloadParsers/NicknameParserFactory.h
@@ -6,8 +6,8 @@
#pragma once
-#include "Swiften/Parser/GenericPayloadParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/NicknameParser.h"
+#include <Swiften/Parser/GenericPayloadParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/NicknameParser.h>
namespace Swift {
class NicknameParserFactory : public GenericPayloadParserFactory<NicknameParser> {
diff --git a/Swiften/Parser/PayloadParsers/PriorityParser.cpp b/Swiften/Parser/PayloadParsers/PriorityParser.cpp
index bcbf67f..b440444 100644
--- a/Swiften/Parser/PayloadParsers/PriorityParser.cpp
+++ b/Swiften/Parser/PayloadParsers/PriorityParser.cpp
@@ -4,7 +4,7 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/PriorityParser.h"
+#include <Swiften/Parser/PayloadParsers/PriorityParser.h>
#include <boost/lexical_cast.hpp>
@@ -24,7 +24,7 @@ void PriorityParser::handleEndElement(const std::string&, const std::string&) {
try {
priority = boost::lexical_cast<int>(text_);
}
- catch (boost::bad_lexical_cast& e) {
+ catch (boost::bad_lexical_cast&) {
}
getPayloadInternal()->setPriority(priority);
}
diff --git a/Swiften/Parser/PayloadParsers/PriorityParser.h b/Swiften/Parser/PayloadParsers/PriorityParser.h
index 1b02255..8d6bf86 100644
--- a/Swiften/Parser/PayloadParsers/PriorityParser.h
+++ b/Swiften/Parser/PayloadParsers/PriorityParser.h
@@ -4,11 +4,10 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#ifndef SWIFTEN_PriorityParser_H
-#define SWIFTEN_PriorityParser_H
+#pragma once
-#include "Swiften/Elements/Priority.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
+#include <Swiften/Elements/Priority.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
class PriorityParser : public GenericPayloadParser<Priority> {
@@ -24,5 +23,3 @@ namespace Swift {
std::string text_;
};
}
-
-#endif
diff --git a/Swiften/Parser/PayloadParsers/PrivateStorageParser.cpp b/Swiften/Parser/PayloadParsers/PrivateStorageParser.cpp
index 026da96..b7bcd5d 100644
--- a/Swiften/Parser/PayloadParsers/PrivateStorageParser.cpp
+++ b/Swiften/Parser/PayloadParsers/PrivateStorageParser.cpp
@@ -4,9 +4,9 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/PrivateStorageParser.h"
-#include "Swiften/Parser/PayloadParserFactoryCollection.h"
-#include "Swiften/Parser/PayloadParserFactory.h"
+#include <Swiften/Parser/PayloadParsers/PrivateStorageParser.h>
+#include <Swiften/Parser/PayloadParserFactoryCollection.h>
+#include <Swiften/Parser/PayloadParserFactory.h>
namespace Swift {
diff --git a/Swiften/Parser/PayloadParsers/PrivateStorageParser.h b/Swiften/Parser/PayloadParsers/PrivateStorageParser.h
index f5f569a..d350593 100644
--- a/Swiften/Parser/PayloadParsers/PrivateStorageParser.h
+++ b/Swiften/Parser/PayloadParsers/PrivateStorageParser.h
@@ -8,8 +8,8 @@
#include <boost/optional.hpp>
-#include "Swiften/Elements/PrivateStorage.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
+#include <Swiften/Elements/PrivateStorage.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
class PayloadParserFactoryCollection;
@@ -26,6 +26,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* factories;
int level;
- std::auto_ptr<PayloadParser> currentPayloadParser;
+ boost::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PrivateStorageParserFactory.h b/Swiften/Parser/PayloadParsers/PrivateStorageParserFactory.h
index 9399ace..5b93aef 100644
--- a/Swiften/Parser/PayloadParsers/PrivateStorageParserFactory.h
+++ b/Swiften/Parser/PayloadParsers/PrivateStorageParserFactory.h
@@ -6,8 +6,8 @@
#pragma once
-#include "Swiften/Parser/PayloadParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/PrivateStorageParser.h"
+#include <Swiften/Parser/PayloadParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/PrivateStorageParser.h>
namespace Swift {
class PayloadParserFactoryCollection;
diff --git a/Swiften/Parser/PayloadParsers/RawXMLPayloadParser.cpp b/Swiften/Parser/PayloadParsers/RawXMLPayloadParser.cpp
index bc9b843..0837ae8 100644
--- a/Swiften/Parser/PayloadParsers/RawXMLPayloadParser.cpp
+++ b/Swiften/Parser/PayloadParsers/RawXMLPayloadParser.cpp
@@ -4,8 +4,8 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/RawXMLPayloadParser.h"
-#include "Swiften/Parser/SerializingParser.h"
+#include <Swiften/Parser/PayloadParsers/RawXMLPayloadParser.h>
+#include <Swiften/Parser/SerializingParser.h>
namespace Swift {
diff --git a/Swiften/Parser/PayloadParsers/RawXMLPayloadParser.h b/Swiften/Parser/PayloadParsers/RawXMLPayloadParser.h
index b5c887a..4a027a1 100644
--- a/Swiften/Parser/PayloadParsers/RawXMLPayloadParser.h
+++ b/Swiften/Parser/PayloadParsers/RawXMLPayloadParser.h
@@ -6,9 +6,9 @@
#pragma once
-#include "Swiften/Elements/RawXMLPayload.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
-#include "Swiften/Parser/SerializingParser.h"
+#include <Swiften/Elements/RawXMLPayload.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
+#include <Swiften/Parser/SerializingParser.h>
namespace Swift {
class SerializingParser;
diff --git a/Swiften/Parser/PayloadParsers/RawXMLPayloadParserFactory.h b/Swiften/Parser/PayloadParsers/RawXMLPayloadParserFactory.h
index b180e1e..d777caa 100644
--- a/Swiften/Parser/PayloadParsers/RawXMLPayloadParserFactory.h
+++ b/Swiften/Parser/PayloadParsers/RawXMLPayloadParserFactory.h
@@ -6,8 +6,8 @@
#pragma once
-#include "Swiften/Parser/PayloadParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/RawXMLPayloadParser.h"
+#include <Swiften/Parser/PayloadParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/RawXMLPayloadParser.h>
#include <string>
namespace Swift {
diff --git a/Swiften/Parser/PayloadParsers/ReplaceParser.cpp b/Swiften/Parser/PayloadParsers/ReplaceParser.cpp
new file mode 100644
index 0000000..fb85fbd
--- /dev/null
+++ b/Swiften/Parser/PayloadParsers/ReplaceParser.cpp
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2011 Vlad Voicu
+ * Licensed under the Simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+#include <Swiften/Parser/PayloadParsers/ReplaceParser.h>
+
+namespace Swift {
+
+ ReplaceParser::ReplaceParser() : level_(0) {
+ }
+
+ void ReplaceParser::handleStartElement(const std::string&, const std::string&, const AttributeMap& attributes) {
+ if (level_ == 0) {
+ std::string id = attributes.getAttribute("id");
+ getPayloadInternal()->setID(id);
+ }
+ level_++;
+ }
+
+ void ReplaceParser::handleEndElement(const std::string&, const std::string&) {
+ --level_;
+ }
+
+ void ReplaceParser::handleCharacterData(const std::string&) {
+ }
+
+}
diff --git a/Swiften/Parser/PayloadParsers/ReplaceParser.h b/Swiften/Parser/PayloadParsers/ReplaceParser.h
new file mode 100644
index 0000000..4d73459
--- /dev/null
+++ b/Swiften/Parser/PayloadParsers/ReplaceParser.h
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2011 Vlad Voicu
+ * Licensed under the Simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+#pragma once
+
+#include <Swiften/Elements/Replace.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
+
+namespace Swift {
+ class ReplaceParser : public GenericPayloadParser<Replace> {
+ public:
+ ReplaceParser();
+ virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes);
+ virtual void handleEndElement(const std::string& element, const std::string&);
+ virtual void handleCharacterData(const std::string& data);
+
+ private:
+ int level_;
+ };
+}
diff --git a/Swiften/Parser/PayloadParsers/ResourceBindParser.cpp b/Swiften/Parser/PayloadParsers/ResourceBindParser.cpp
index 5c3affb..81378df 100644
--- a/Swiften/Parser/PayloadParsers/ResourceBindParser.cpp
+++ b/Swiften/Parser/PayloadParsers/ResourceBindParser.cpp
@@ -4,7 +4,7 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/ResourceBindParser.h"
+#include <Swiften/Parser/PayloadParsers/ResourceBindParser.h>
namespace Swift {
diff --git a/Swiften/Parser/PayloadParsers/ResourceBindParser.h b/Swiften/Parser/PayloadParsers/ResourceBindParser.h
index 875b5f4..e604751 100644
--- a/Swiften/Parser/PayloadParsers/ResourceBindParser.h
+++ b/Swiften/Parser/PayloadParsers/ResourceBindParser.h
@@ -4,11 +4,10 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#ifndef SWIFTEN_ResourceBindParser_H
-#define SWIFTEN_ResourceBindParser_H
+#pragma once
-#include "Swiften/Elements/ResourceBind.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
+#include <Swiften/Elements/ResourceBind.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
class ResourceBindParser : public GenericPayloadParser<ResourceBind> {
@@ -26,5 +25,3 @@ namespace Swift {
std::string text_;
};
}
-
-#endif
diff --git a/Swiften/Parser/PayloadParsers/RosterItemExchangeParser.cpp b/Swiften/Parser/PayloadParsers/RosterItemExchangeParser.cpp
new file mode 100644
index 0000000..32be2c7
--- /dev/null
+++ b/Swiften/Parser/PayloadParsers/RosterItemExchangeParser.cpp
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2011 Jan Kaluza
+ * Licensed under the Simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+#include <Swiften/Parser/PayloadParsers/RosterItemExchangeParser.h>
+#include <Swiften/Parser/SerializingParser.h>
+
+namespace Swift {
+
+RosterItemExchangeParser::RosterItemExchangeParser() : level_(TopLevel), inItem_(false) {
+}
+
+void RosterItemExchangeParser::handleStartElement(const std::string& element, const std::string& /*ns*/, const AttributeMap& attributes) {
+ if (level_ == PayloadLevel) {
+ if (element == "item") {
+ inItem_ = true;
+
+ currentItem_ = RosterItemExchangePayload::Item();
+
+ currentItem_.setJID(JID(attributes.getAttribute("jid")));
+ currentItem_.setName(attributes.getAttribute("name"));
+
+ std::string action = attributes.getAttribute("action");
+ if (action == "add") {
+ currentItem_.setAction(RosterItemExchangePayload::Item::Add);
+ }
+ else if (action == "modify") {
+ currentItem_.setAction(RosterItemExchangePayload::Item::Modify);
+ }
+ else if (action == "delete") {
+ currentItem_.setAction(RosterItemExchangePayload::Item::Delete);
+ }
+ else {
+ // Add is default action according to XEP
+ currentItem_.setAction(RosterItemExchangePayload::Item::Add);
+ }
+ }
+ }
+ else if (level_ == ItemLevel) {
+ if (element == "group") {
+ currentText_ = "";
+ }
+ }
+ ++level_;
+}
+
+void RosterItemExchangeParser::handleEndElement(const std::string& element, const std::string& /*ns*/) {
+ --level_;
+ if (level_ == PayloadLevel) {
+ if (inItem_) {
+ getPayloadInternal()->addItem(currentItem_);
+ inItem_ = false;
+ }
+ }
+ else if (level_ == ItemLevel) {
+ if (element == "group") {
+ currentItem_.addGroup(currentText_);
+ }
+ }
+}
+
+void RosterItemExchangeParser::handleCharacterData(const std::string& data) {
+ currentText_ += data;
+}
+
+}
diff --git a/Swiften/Parser/PayloadParsers/RosterItemExchangeParser.h b/Swiften/Parser/PayloadParsers/RosterItemExchangeParser.h
new file mode 100644
index 0000000..5652b94
--- /dev/null
+++ b/Swiften/Parser/PayloadParsers/RosterItemExchangeParser.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2011 Jan Kaluza
+ * Licensed under the Simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+#pragma once
+
+#include <Swiften/Elements/RosterItemExchangePayload.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
+
+namespace Swift {
+ class SerializingParser;
+
+ class RosterItemExchangeParser : public GenericPayloadParser<RosterItemExchangePayload> {
+ public:
+ RosterItemExchangeParser();
+
+ virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes);
+ virtual void handleEndElement(const std::string& element, const std::string&);
+ virtual void handleCharacterData(const std::string& data);
+
+ private:
+ enum Level {
+ TopLevel = 0,
+ PayloadLevel = 1,
+ ItemLevel = 2
+ };
+ int level_;
+ bool inItem_;
+ RosterItemExchangePayload::Item currentItem_;
+ std::string currentText_;
+ };
+}
diff --git a/Swiften/Parser/PayloadParsers/RosterParser.cpp b/Swiften/Parser/PayloadParsers/RosterParser.cpp
index ba19fbf..53c433a 100644
--- a/Swiften/Parser/PayloadParsers/RosterParser.cpp
+++ b/Swiften/Parser/PayloadParsers/RosterParser.cpp
@@ -4,8 +4,11 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/RosterParser.h"
-#include "Swiften/Parser/SerializingParser.h"
+#include <Swiften/Parser/PayloadParsers/RosterParser.h>
+
+#include <boost/optional.hpp>
+
+#include <Swiften/Parser/SerializingParser.h>
namespace Swift {
@@ -13,7 +16,13 @@ RosterParser::RosterParser() : level_(TopLevel), inItem_(false), unknownContentP
}
void RosterParser::handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) {
- if (level_ == PayloadLevel) {
+ if (level_ == TopLevel) {
+ boost::optional<std::string> ver = attributes.getAttributeValue("ver");
+ if (ver) {
+ getPayloadInternal()->setVersion(*ver);
+ }
+ }
+ else if (level_ == PayloadLevel) {
if (element == "item") {
inItem_ = true;
currentItem_ = RosterItemPayload();
diff --git a/Swiften/Parser/PayloadParsers/RosterParser.h b/Swiften/Parser/PayloadParsers/RosterParser.h
index ac72696..c29064f 100644
--- a/Swiften/Parser/PayloadParsers/RosterParser.h
+++ b/Swiften/Parser/PayloadParsers/RosterParser.h
@@ -4,11 +4,10 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#ifndef SWIFTEN_RosterParser_H
-#define SWIFTEN_RosterParser_H
+#pragma once
-#include "Swiften/Elements/RosterPayload.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
+#include <Swiften/Elements/RosterPayload.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
class SerializingParser;
@@ -34,5 +33,3 @@ namespace Swift {
SerializingParser* unknownContentParser_;
};
}
-
-#endif
diff --git a/Swiften/Parser/PayloadParsers/SearchPayloadParser.cpp b/Swiften/Parser/PayloadParsers/SearchPayloadParser.cpp
index 9daf842..f4de503 100644
--- a/Swiften/Parser/PayloadParsers/SearchPayloadParser.cpp
+++ b/Swiften/Parser/PayloadParsers/SearchPayloadParser.cpp
@@ -4,12 +4,12 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/SearchPayloadParser.h"
+#include <Swiften/Parser/PayloadParsers/SearchPayloadParser.h>
#include <boost/cast.hpp>
-#include "Swiften/Parser/PayloadParsers/FormParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/FormParser.h"
+#include <Swiften/Parser/PayloadParsers/FormParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/FormParser.h>
namespace Swift {
diff --git a/Swiften/Parser/PayloadParsers/SearchPayloadParser.h b/Swiften/Parser/PayloadParsers/SearchPayloadParser.h
index 01441e8..006e0d9 100644
--- a/Swiften/Parser/PayloadParsers/SearchPayloadParser.h
+++ b/Swiften/Parser/PayloadParsers/SearchPayloadParser.h
@@ -8,8 +8,8 @@
#include <boost/optional.hpp>
-#include "Swiften/Elements/SearchPayload.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
+#include <Swiften/Elements/SearchPayload.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
class FormParserFactory;
diff --git a/Swiften/Parser/PayloadParsers/SearchPayloadParserFactory.h b/Swiften/Parser/PayloadParsers/SearchPayloadParserFactory.h
index 0f8a6c7..5130556 100644
--- a/Swiften/Parser/PayloadParsers/SearchPayloadParserFactory.h
+++ b/Swiften/Parser/PayloadParsers/SearchPayloadParserFactory.h
@@ -6,8 +6,8 @@
#pragma once
-#include "Swiften/Parser/GenericPayloadParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/SearchPayloadParser.h"
+#include <Swiften/Parser/GenericPayloadParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/SearchPayloadParser.h>
namespace Swift {
class SearchPayloadParserFactory : public GenericPayloadParserFactory<SearchPayloadParser> {
diff --git a/Swiften/Parser/PayloadParsers/SecurityLabelParser.cpp b/Swiften/Parser/PayloadParsers/SecurityLabelParser.cpp
index b769a47..0b0f104 100644
--- a/Swiften/Parser/PayloadParsers/SecurityLabelParser.cpp
+++ b/Swiften/Parser/PayloadParsers/SecurityLabelParser.cpp
@@ -4,8 +4,8 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/SecurityLabelParser.h"
-#include "Swiften/Parser/SerializingParser.h"
+#include <Swiften/Parser/PayloadParsers/SecurityLabelParser.h>
+#include <Swiften/Parser/SerializingParser.h>
namespace Swift {
diff --git a/Swiften/Parser/PayloadParsers/SecurityLabelParser.h b/Swiften/Parser/PayloadParsers/SecurityLabelParser.h
index b54c3be..676cebc 100644
--- a/Swiften/Parser/PayloadParsers/SecurityLabelParser.h
+++ b/Swiften/Parser/PayloadParsers/SecurityLabelParser.h
@@ -4,11 +4,10 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#ifndef SWIFTEN_SecurityLabelParser_H
-#define SWIFTEN_SecurityLabelParser_H
+#pragma once
-#include "Swiften/Elements/SecurityLabel.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
+#include <Swiften/Elements/SecurityLabel.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
class SerializingParser;
@@ -33,5 +32,3 @@ namespace Swift {
std::string currentText_;
};
}
-
-#endif
diff --git a/Swiften/Parser/PayloadParsers/SecurityLabelParserFactory.h b/Swiften/Parser/PayloadParsers/SecurityLabelParserFactory.h
index 538d4a1..47c4a0c 100644
--- a/Swiften/Parser/PayloadParsers/SecurityLabelParserFactory.h
+++ b/Swiften/Parser/PayloadParsers/SecurityLabelParserFactory.h
@@ -4,11 +4,10 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#ifndef SWIFTEN_SecurityLabelParserFactory_H
-#define SWIFTEN_SecurityLabelParserFactory_H
+#pragma once
-#include "Swiften/Parser/GenericPayloadParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/SecurityLabelParser.h"
+#include <Swiften/Parser/GenericPayloadParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/SecurityLabelParser.h>
namespace Swift {
class SecurityLabelParserFactory : public GenericPayloadParserFactory<SecurityLabelParser> {
@@ -16,5 +15,3 @@ namespace Swift {
SecurityLabelParserFactory() : GenericPayloadParserFactory<SecurityLabelParser>("securitylabel", "urn:xmpp:sec-label:0") {}
};
}
-
-#endif
diff --git a/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.cpp b/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.cpp
index 6a366b3..e90573f 100644
--- a/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.cpp
+++ b/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.cpp
@@ -4,9 +4,9 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.h"
-#include "Swiften/Parser/PayloadParsers/SecurityLabelParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/SecurityLabelParser.h"
+#include <Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.h>
+#include <Swiften/Parser/PayloadParsers/SecurityLabelParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/SecurityLabelParser.h>
namespace Swift {
diff --git a/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.h b/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.h
index ca422d1..d50faa4 100644
--- a/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.h
+++ b/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.h
@@ -4,11 +4,10 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#ifndef SWIFTEN_SecurityLabelsCatalogParser_H
-#define SWIFTEN_SecurityLabelsCatalogParser_H
+#pragma once
-#include "Swiften/Elements/SecurityLabelsCatalog.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
+#include <Swiften/Elements/SecurityLabelsCatalog.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
class SecurityLabelParserFactory;
@@ -36,5 +35,3 @@ namespace Swift {
boost::shared_ptr<SecurityLabelsCatalog::Item> currentItem_;
};
}
-
-#endif
diff --git a/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParserFactory.h b/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParserFactory.h
index a148d81..a93100a 100644
--- a/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParserFactory.h
+++ b/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParserFactory.h
@@ -4,11 +4,10 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#ifndef SWIFTEN_SecurityLabelsCatalogParserFactory_H
-#define SWIFTEN_SecurityLabelsCatalogParserFactory_H
+#pragma once
-#include "Swiften/Parser/GenericPayloadParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.h"
+#include <Swiften/Parser/GenericPayloadParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.h>
namespace Swift {
class SecurityLabelsCatalogParserFactory : public GenericPayloadParserFactory<SecurityLabelsCatalogParser> {
@@ -16,5 +15,3 @@ namespace Swift {
SecurityLabelsCatalogParserFactory() : GenericPayloadParserFactory<SecurityLabelsCatalogParser>("catalog", "urn:xmpp:sec-label:catalog:2") {}
};
}
-
-#endif
diff --git a/Swiften/Parser/PayloadParsers/SoftwareVersionParser.cpp b/Swiften/Parser/PayloadParsers/SoftwareVersionParser.cpp
index f8e61c7..b1c3e18 100644
--- a/Swiften/Parser/PayloadParsers/SoftwareVersionParser.cpp
+++ b/Swiften/Parser/PayloadParsers/SoftwareVersionParser.cpp
@@ -4,7 +4,7 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/SoftwareVersionParser.h"
+#include <Swiften/Parser/PayloadParsers/SoftwareVersionParser.h>
namespace Swift {
diff --git a/Swiften/Parser/PayloadParsers/SoftwareVersionParser.h b/Swiften/Parser/PayloadParsers/SoftwareVersionParser.h
index 4272e5a..01d5ed8 100644
--- a/Swiften/Parser/PayloadParsers/SoftwareVersionParser.h
+++ b/Swiften/Parser/PayloadParsers/SoftwareVersionParser.h
@@ -4,11 +4,10 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#ifndef SWIFTEN_SoftwareVersionParser_H
-#define SWIFTEN_SoftwareVersionParser_H
+#pragma once
-#include "Swiften/Elements/SoftwareVersion.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
+#include <Swiften/Elements/SoftwareVersion.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
class SoftwareVersionParser : public GenericPayloadParser<SoftwareVersion> {
@@ -28,5 +27,3 @@ namespace Swift {
std::string currentText_;
};
}
-
-#endif
diff --git a/Swiften/Parser/PayloadParsers/StartSessionParser.h b/Swiften/Parser/PayloadParsers/StartSessionParser.h
index ba6e3c8..ce78ae7 100644
--- a/Swiften/Parser/PayloadParsers/StartSessionParser.h
+++ b/Swiften/Parser/PayloadParsers/StartSessionParser.h
@@ -4,11 +4,10 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#ifndef SWIFTEN_StartSessionParser_H
-#define SWIFTEN_StartSessionParser_H
+#pragma once
-#include "Swiften/Elements/StartSession.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
+#include <Swiften/Elements/StartSession.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
class StartSessionParser : public GenericPayloadParser<StartSession> {
@@ -20,5 +19,3 @@ namespace Swift {
virtual void handleCharacterData(const std::string&) {}
};
}
-
-#endif
diff --git a/Swiften/Parser/PayloadParsers/StatusParser.cpp b/Swiften/Parser/PayloadParsers/StatusParser.cpp
index a5d00de..1394d46 100644
--- a/Swiften/Parser/PayloadParsers/StatusParser.cpp
+++ b/Swiften/Parser/PayloadParsers/StatusParser.cpp
@@ -4,7 +4,7 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/StatusParser.h"
+#include <Swiften/Parser/PayloadParsers/StatusParser.h>
namespace Swift {
diff --git a/Swiften/Parser/PayloadParsers/StatusParser.h b/Swiften/Parser/PayloadParsers/StatusParser.h
index 4c6f4ac..9d7493e 100644
--- a/Swiften/Parser/PayloadParsers/StatusParser.h
+++ b/Swiften/Parser/PayloadParsers/StatusParser.h
@@ -4,11 +4,10 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#ifndef SWIFTEN_StatusParser_H
-#define SWIFTEN_StatusParser_H
+#pragma once
-#include "Swiften/Elements/Status.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
+#include <Swiften/Elements/Status.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
class StatusParser : public GenericPayloadParser<Status> {
@@ -24,5 +23,3 @@ namespace Swift {
std::string text_;
};
}
-
-#endif
diff --git a/Swiften/Parser/PayloadParsers/StatusShowParser.cpp b/Swiften/Parser/PayloadParsers/StatusShowParser.cpp
index 774f27d..f5814ec 100644
--- a/Swiften/Parser/PayloadParsers/StatusShowParser.cpp
+++ b/Swiften/Parser/PayloadParsers/StatusShowParser.cpp
@@ -4,7 +4,7 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/StatusShowParser.h"
+#include <Swiften/Parser/PayloadParsers/StatusShowParser.h>
namespace Swift {
diff --git a/Swiften/Parser/PayloadParsers/StatusShowParser.h b/Swiften/Parser/PayloadParsers/StatusShowParser.h
index b4100a3..6e72c13 100644
--- a/Swiften/Parser/PayloadParsers/StatusShowParser.h
+++ b/Swiften/Parser/PayloadParsers/StatusShowParser.h
@@ -4,11 +4,10 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#ifndef SWIFTEN_StatusShowParser_H
-#define SWIFTEN_StatusShowParser_H
+#pragma once
-#include "Swiften/Elements/StatusShow.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
+#include <Swiften/Elements/StatusShow.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
class StatusShowParser : public GenericPayloadParser<StatusShow> {
@@ -24,5 +23,3 @@ namespace Swift {
std::string text_;
};
}
-
-#endif
diff --git a/Swiften/Parser/PayloadParsers/StorageParser.cpp b/Swiften/Parser/PayloadParsers/StorageParser.cpp
index 94cd0ce..05e24e7 100644
--- a/Swiften/Parser/PayloadParsers/StorageParser.cpp
+++ b/Swiften/Parser/PayloadParsers/StorageParser.cpp
@@ -4,7 +4,7 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/StorageParser.h"
+#include <Swiften/Parser/PayloadParsers/StorageParser.h>
#include <cassert>
diff --git a/Swiften/Parser/PayloadParsers/StorageParser.h b/Swiften/Parser/PayloadParsers/StorageParser.h
index 16fd869..76dce90 100644
--- a/Swiften/Parser/PayloadParsers/StorageParser.h
+++ b/Swiften/Parser/PayloadParsers/StorageParser.h
@@ -8,8 +8,8 @@
#include <boost/optional.hpp>
-#include "Swiften/Elements/Storage.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
+#include <Swiften/Elements/Storage.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
class StorageParser : public GenericPayloadParser<Storage> {
diff --git a/Swiften/Parser/PayloadParsers/StreamInitiationParser.cpp b/Swiften/Parser/PayloadParsers/StreamInitiationParser.cpp
index 1cf7fcf..9ea8089 100644
--- a/Swiften/Parser/PayloadParsers/StreamInitiationParser.cpp
+++ b/Swiften/Parser/PayloadParsers/StreamInitiationParser.cpp
@@ -4,14 +4,14 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/StreamInitiationParser.h"
+#include <Swiften/Parser/PayloadParsers/StreamInitiationParser.h>
#include <boost/lexical_cast.hpp>
#include <boost/cast.hpp>
-#include "Swiften/Parser/PayloadParsers/FormParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/FormParser.h"
-#include "Swiften/Base/foreach.h"
+#include <Swiften/Parser/PayloadParsers/FormParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/FormParser.h>
+#include <Swiften/Base/foreach.h>
#define FILE_TRANSFER_NS "http://jabber.org/protocol/si/profile/file-transfer"
@@ -42,7 +42,7 @@ void StreamInitiationParser::handleStartElement(const std::string& element, cons
try {
currentFile.size = boost::lexical_cast<int>(attributes.getAttribute("size"));
}
- catch (boost::bad_lexical_cast& e) {
+ catch (boost::bad_lexical_cast&) {
}
}
else if (element == "feature" && ns == FEATURE_NEG_NS) {
diff --git a/Swiften/Parser/PayloadParsers/StreamInitiationParser.h b/Swiften/Parser/PayloadParsers/StreamInitiationParser.h
index 46f5b2f..c2ffd07 100644
--- a/Swiften/Parser/PayloadParsers/StreamInitiationParser.h
+++ b/Swiften/Parser/PayloadParsers/StreamInitiationParser.h
@@ -8,8 +8,8 @@
#include <boost/optional.hpp>
-#include "Swiften/Elements/StreamInitiation.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
+#include <Swiften/Elements/StreamInitiation.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
class FormParserFactory;
diff --git a/Swiften/Parser/PayloadParsers/StreamInitiationParserFactory.h b/Swiften/Parser/PayloadParsers/StreamInitiationParserFactory.h
index ee5ed09..a75cf37 100644
--- a/Swiften/Parser/PayloadParsers/StreamInitiationParserFactory.h
+++ b/Swiften/Parser/PayloadParsers/StreamInitiationParserFactory.h
@@ -6,8 +6,8 @@
#pragma once
-#include "Swiften/Parser/GenericPayloadParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/StreamInitiationParser.h"
+#include <Swiften/Parser/GenericPayloadParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/StreamInitiationParser.h>
namespace Swift {
class StreamInitiationParserFactory : public GenericPayloadParserFactory<StreamInitiationParser> {
diff --git a/Swiften/Parser/PayloadParsers/SubjectParser.cpp b/Swiften/Parser/PayloadParsers/SubjectParser.cpp
index d7d9af8..276a05a 100644
--- a/Swiften/Parser/PayloadParsers/SubjectParser.cpp
+++ b/Swiften/Parser/PayloadParsers/SubjectParser.cpp
@@ -4,7 +4,7 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/SubjectParser.h"
+#include <Swiften/Parser/PayloadParsers/SubjectParser.h>
namespace Swift {
diff --git a/Swiften/Parser/PayloadParsers/SubjectParser.h b/Swiften/Parser/PayloadParsers/SubjectParser.h
index 78e5a9e..1d7d2ce 100644
--- a/Swiften/Parser/PayloadParsers/SubjectParser.h
+++ b/Swiften/Parser/PayloadParsers/SubjectParser.h
@@ -6,8 +6,8 @@
#pragma once
-#include "Swiften/Elements/Subject.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
+#include <Swiften/Elements/Subject.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
class SubjectParser : public GenericPayloadParser<Subject> {
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/BodyParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/BodyParserTest.cpp
index bb53586..fe91088 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/BodyParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/BodyParserTest.cpp
@@ -7,8 +7,8 @@
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
-#include "Swiften/Parser/PayloadParsers/BodyParser.h"
-#include "Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h"
+#include <Swiften/Parser/PayloadParsers/BodyParser.h>
+#include <Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h>
using namespace Swift;
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/CommandParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/CommandParserTest.cpp
index 7ebcbac..3e4971b 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/CommandParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/CommandParserTest.cpp
@@ -7,8 +7,8 @@
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
-#include "Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h"
-#include "Swiften/Elements/Command.h"
+#include <Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h>
+#include <Swiften/Elements/Command.h>
using namespace Swift;
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/DiscoInfoParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/DiscoInfoParserTest.cpp
index 793e0c2..bfbc312 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/DiscoInfoParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/DiscoInfoParserTest.cpp
@@ -7,8 +7,8 @@
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
-#include "Swiften/Parser/PayloadParsers/DiscoInfoParser.h"
-#include "Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h"
+#include <Swiften/Parser/PayloadParsers/DiscoInfoParser.h>
+#include <Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h>
using namespace Swift;
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/ErrorParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/ErrorParserTest.cpp
index 02c2f7d..005fc09 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/ErrorParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/ErrorParserTest.cpp
@@ -7,14 +7,16 @@
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
-#include "Swiften/Parser/PayloadParsers/ErrorParser.h"
-#include "Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h"
+#include <Swiften/Parser/PayloadParsers/ErrorParser.h>
+#include <Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h>
+#include <Swiften/Elements/Delay.h>
using namespace Swift;
class ErrorParserTest : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(ErrorParserTest);
CPPUNIT_TEST(testParse);
+ CPPUNIT_TEST(testParseWithPayload);
CPPUNIT_TEST_SUITE_END();
public:
@@ -31,7 +33,26 @@ class ErrorParserTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(ErrorPayload::BadRequest, payload->getCondition());
CPPUNIT_ASSERT_EQUAL(ErrorPayload::Modify, payload->getType());
CPPUNIT_ASSERT_EQUAL(std::string("boo"), payload->getText());
+ CPPUNIT_ASSERT(!payload->getPayload());
}
+
+ void testParseWithPayload() {
+ PayloadsParserTester parser;
+
+ CPPUNIT_ASSERT(parser.parse(
+ "<error type=\"modify\">"
+ "<bad-request xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\"/>"
+ "<delay xmlns='urn:xmpp:delay' from='juliet@capulet.com/balcony' stamp='2002-09-10T23:41:07Z'/>"
+ "<text xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\">boo</text>"
+ "</error>"));
+
+ ErrorPayload::ref payload = boost::dynamic_pointer_cast<ErrorPayload>(parser.getPayload());
+ CPPUNIT_ASSERT_EQUAL(ErrorPayload::BadRequest, payload->getCondition());
+ CPPUNIT_ASSERT_EQUAL(ErrorPayload::Modify, payload->getType());
+ CPPUNIT_ASSERT_EQUAL(std::string("boo"), payload->getText());
+ CPPUNIT_ASSERT(boost::dynamic_pointer_cast<Delay>(payload->getPayload()));
+ }
+
};
CPPUNIT_TEST_SUITE_REGISTRATION(ErrorParserTest);
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/FormParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/FormParserTest.cpp
index 6ec825b..86845be 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/FormParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/FormParserTest.cpp
@@ -7,8 +7,8 @@
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
-#include "Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h"
-#include "Swiften/Elements/Form.h"
+#include <Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h>
+#include <Swiften/Elements/Form.h>
using namespace Swift;
@@ -77,7 +77,6 @@ class FormParserTest : public CppUnit::TestFixture {
"</field>"
"<field var=\"untyped\">"
"<value>foo</value>"
- "<value>baz</value>"
"</field>"
"</x>"));
@@ -114,8 +113,7 @@ class FormParserTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(JID("baz@fum.org"), boost::dynamic_pointer_cast<JIDMultiFormField>(payload->getFields()[8])->getValue()[1]);
CPPUNIT_ASSERT_EQUAL(std::string("Tell all your friends about your new bot!"), payload->getFields()[8]->getDescription());
- CPPUNIT_ASSERT_EQUAL(std::string("foo"), boost::dynamic_pointer_cast<UntypedFormField>(payload->getFields()[9])->getValue()[0]);
- CPPUNIT_ASSERT_EQUAL(std::string("baz"), boost::dynamic_pointer_cast<UntypedFormField>(payload->getFields()[9])->getValue()[1]);
+ CPPUNIT_ASSERT_EQUAL(std::string("foo"), boost::dynamic_pointer_cast<TextSingleFormField>(payload->getFields()[9])->getValue());
}
};
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/IBBParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/IBBParserTest.cpp
index b4229f2..90d7b6b 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/IBBParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/IBBParserTest.cpp
@@ -4,13 +4,13 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Base/ByteArray.h"
+#include <Swiften/Base/ByteArray.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
-#include "Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h"
-#include "Swiften/Elements/IBB.h"
+#include <Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h>
+#include <Swiften/Elements/IBB.h>
using namespace Swift;
@@ -32,7 +32,7 @@ class IBBParserTest : public CppUnit::TestFixture {
IBB::ref ibb = parser.getPayload<IBB>();
CPPUNIT_ASSERT(ibb->getAction() == IBB::Data);
- CPPUNIT_ASSERT_EQUAL(ByteArray("abcdefgihjklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890\x0a"), ibb->getData());
+ CPPUNIT_ASSERT(createByteArray("abcdefgihjklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890\x0a") == ibb->getData());
CPPUNIT_ASSERT_EQUAL(4, ibb->getSequenceNumber());
}
};
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/PayloadParserTester.h b/Swiften/Parser/PayloadParsers/UnitTest/PayloadParserTester.h
index 32fc56c..b0f68ab 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/PayloadParserTester.h
+++ b/Swiften/Parser/PayloadParsers/UnitTest/PayloadParserTester.h
@@ -6,8 +6,8 @@
#pragma once
-#include "Swiften/Parser/UnitTest/ParserTester.h"
-#include "Swiften/Parser/PayloadParser.h"
+#include <Swiften/Parser/UnitTest/ParserTester.h>
+#include <Swiften/Parser/PayloadParser.h>
namespace Swift {
typedef ParserTester<PayloadParser> PayloadParserTester;
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h b/Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h
index 2c88955..213cd06 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h
+++ b/Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h
@@ -8,12 +8,12 @@
#include <cppunit/extensions/HelperMacros.h>
-#include "Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h"
-#include "Swiften/Parser/XMLParser.h"
-#include "Swiften/Parser/XMLParserClient.h"
-#include "Swiften/Parser/PlatformXMLParserFactory.h"
-#include "Swiften/Elements/Payload.h"
-#include "Swiften/Parser/PayloadParser.h"
+#include <Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h>
+#include <Swiften/Parser/XMLParser.h>
+#include <Swiften/Parser/XMLParserClient.h>
+#include <Swiften/Parser/PlatformXMLParserFactory.h>
+#include <Swiften/Elements/Payload.h>
+#include <Swiften/Parser/PayloadParser.h>
namespace Swift {
class PayloadsParserTester : public XMLParserClient {
@@ -62,7 +62,7 @@ namespace Swift {
private:
XMLParser* xmlParser;
FullPayloadParserFactoryCollection factories;
- std::auto_ptr<PayloadParser> payloadParser;
+ boost::shared_ptr<PayloadParser> payloadParser;
int level;
};
}
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/PriorityParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/PriorityParserTest.cpp
index 68a2e4f..0974aec 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/PriorityParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/PriorityParserTest.cpp
@@ -7,8 +7,8 @@
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
-#include "Swiften/Parser/PayloadParsers/PriorityParser.h"
-#include "Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h"
+#include <Swiften/Parser/PayloadParsers/PriorityParser.h>
+#include <Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h>
using namespace Swift;
@@ -24,7 +24,7 @@ class PriorityParserTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT(parser.parse("<priority>-120</priority>"));
- Priority::ref payload = boost::dynamic_pointer_cast<Priority>(parser.getPayload());
+ boost::shared_ptr<Priority> payload = boost::dynamic_pointer_cast<Priority>(parser.getPayload());
CPPUNIT_ASSERT_EQUAL(-120, payload->getPriority());
}
@@ -33,7 +33,7 @@ class PriorityParserTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT(parser.parse("<priority>invalid</priority>"));
- Priority::ref payload = boost::dynamic_pointer_cast<Priority>(parser.getPayload());
+ boost::shared_ptr<Priority> payload = boost::dynamic_pointer_cast<Priority>(parser.getPayload());
CPPUNIT_ASSERT_EQUAL(0, payload->getPriority());
}
};
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/PrivateStorageParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/PrivateStorageParserTest.cpp
index 867b25f..ef6ed9a 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/PrivateStorageParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/PrivateStorageParserTest.cpp
@@ -7,10 +7,10 @@
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
-#include "Swiften/Elements/Storage.h"
-#include "Swiften/Parser/PayloadParsers/PrivateStorageParser.h"
-#include "Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h"
-#include "Swiften/Parser/PayloadParsers/UnitTest/PayloadParserTester.h"
+#include <Swiften/Elements/Storage.h>
+#include <Swiften/Parser/PayloadParsers/PrivateStorageParser.h>
+#include <Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h>
+#include <Swiften/Parser/PayloadParsers/UnitTest/PayloadParserTester.h>
using namespace Swift;
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/RawXMLPayloadParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/RawXMLPayloadParserTest.cpp
index 8885974..4862584 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/RawXMLPayloadParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/RawXMLPayloadParserTest.cpp
@@ -7,8 +7,8 @@
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
-#include "Swiften/Parser/PayloadParsers/RawXMLPayloadParser.h"
-#include "Swiften/Parser/PayloadParsers/UnitTest/PayloadParserTester.h"
+#include <Swiften/Parser/PayloadParsers/RawXMLPayloadParser.h>
+#include <Swiften/Parser/PayloadParsers/UnitTest/PayloadParserTester.h>
using namespace Swift;
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/ReplaceTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/ReplaceTest.cpp
new file mode 100644
index 0000000..c3f410f
--- /dev/null
+++ b/Swiften/Parser/PayloadParsers/UnitTest/ReplaceTest.cpp
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2011 Vlad Voicu
+ * Licensed under the Simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+
+#include <Swiften/Parser/PayloadParsers/ReplaceParser.h>
+#include <Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h>
+
+using namespace Swift;
+
+class ReplaceParserTest : public CppUnit::TestFixture {
+ CPPUNIT_TEST_SUITE(ReplaceParserTest);
+ CPPUNIT_TEST(testParseTrivial);
+ CPPUNIT_TEST(testParseChild);
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+ void testParseTrivial() {
+ PayloadsParserTester parser;
+ CPPUNIT_ASSERT(parser.parse("<replace id='bad1' xmlns='http://swift.im/protocol/replace'/>"));
+ Replace::ref payload = boost::dynamic_pointer_cast <Replace>(parser.getPayload());
+ CPPUNIT_ASSERT_EQUAL(std::string("bad1"), payload->getID());
+ }
+ void testParseChild() {
+ PayloadsParserTester parser;
+ CPPUNIT_ASSERT(parser.parse("<replace id='bad1' xmlns='http://swift.im/protocol/replace' ><child xmlns='blah' id=\"hi\"/></replace>"));
+ Replace::ref payload = boost::dynamic_pointer_cast <Replace>(parser.getPayload());
+ CPPUNIT_ASSERT_EQUAL(std::string("bad1"), payload->getID());
+ }
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION(ReplaceParserTest);
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/ResourceBindParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/ResourceBindParserTest.cpp
index 026ef2c..663a81c 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/ResourceBindParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/ResourceBindParserTest.cpp
@@ -7,8 +7,8 @@
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
-#include "Swiften/Parser/PayloadParsers/ResourceBindParser.h"
-#include "Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h"
+#include <Swiften/Parser/PayloadParsers/ResourceBindParser.h>
+#include <Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h>
using namespace Swift;
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/RosterItemExchangeParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/RosterItemExchangeParserTest.cpp
new file mode 100644
index 0000000..1a18d6d
--- /dev/null
+++ b/Swiften/Parser/PayloadParsers/UnitTest/RosterItemExchangeParserTest.cpp
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2011 Jan Kaluza
+ * Licensed under the Simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+
+#include <Swiften/Parser/PayloadParsers/RosterItemExchangeParser.h>
+#include <Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h>
+
+using namespace Swift;
+
+class RosterItemExchangeParserTest : public CppUnit::TestFixture
+{
+ CPPUNIT_TEST_SUITE(RosterItemExchangeParserTest);
+ CPPUNIT_TEST(testParse);
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+ void testParse() {
+ PayloadsParserTester parser;
+ CPPUNIT_ASSERT(parser.parse(
+ "<x xmlns=\"http://jabber.org/protocol/rosterx\">"
+ "<item action=\"add\" jid=\"foo@bar.com\" name=\"Foo @ Bar\">"
+ "<group>Group 1</group>"
+ "<group>Group 2</group>"
+ "</item>"
+ "<item action=\"modify\" jid=\"baz@blo.com\" name=\"Baz\"/>"
+ "</x>"));
+
+ RosterItemExchangePayload* payload = dynamic_cast<RosterItemExchangePayload*>(parser.getPayload().get());
+ const RosterItemExchangePayload::RosterItemExchangePayloadItems& items = payload->getItems();
+
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), items.size());
+
+ CPPUNIT_ASSERT_EQUAL(JID("foo@bar.com"), items[0].getJID());
+ CPPUNIT_ASSERT_EQUAL(std::string("Foo @ Bar"), items[0].getName());
+ CPPUNIT_ASSERT_EQUAL(RosterItemExchangePayload::Item::Add, items[0].getAction());
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), items[0].getGroups().size());
+ CPPUNIT_ASSERT_EQUAL(std::string("Group 1"), items[0].getGroups()[0]);
+ CPPUNIT_ASSERT_EQUAL(std::string("Group 2"), items[0].getGroups()[1]);
+
+ CPPUNIT_ASSERT_EQUAL(JID("baz@blo.com"), items[1].getJID());
+ CPPUNIT_ASSERT_EQUAL(std::string("Baz"), items[1].getName());
+ CPPUNIT_ASSERT_EQUAL(RosterItemExchangePayload::Item::Modify, items[1].getAction());
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), items[1].getGroups().size());
+ }
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION(RosterItemExchangeParserTest);
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/RosterParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/RosterParserTest.cpp
index 1bcea0e..6cb5dbc 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/RosterParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/RosterParserTest.cpp
@@ -7,8 +7,8 @@
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
-#include "Swiften/Parser/PayloadParsers/RosterParser.h"
-#include "Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h"
+#include <Swiften/Parser/PayloadParsers/RosterParser.h>
+#include <Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h>
using namespace Swift;
@@ -17,6 +17,8 @@ class RosterParserTest : public CppUnit::TestFixture
CPPUNIT_TEST_SUITE(RosterParserTest);
CPPUNIT_TEST(testParse);
CPPUNIT_TEST(testParse_ItemWithUnknownContent);
+ CPPUNIT_TEST(testParse_WithVersion);
+ CPPUNIT_TEST(testParse_WithEmptyVersion);
CPPUNIT_TEST_SUITE_END();
public:
@@ -32,6 +34,8 @@ class RosterParserTest : public CppUnit::TestFixture
"</query>"));
RosterPayload* payload = dynamic_cast<RosterPayload*>(parser.getPayload().get());
+
+ CPPUNIT_ASSERT(!payload->getVersion());
const RosterPayload::RosterItemPayloads& items = payload->getItems();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), items.size());
@@ -74,6 +78,24 @@ class RosterParserTest : public CppUnit::TestFixture
"<baz xmlns=\"jabber:iq:roster\"><fum xmlns=\"jabber:iq:roster\">foo</fum></baz>"
), items[0].getUnknownContent());
}
+
+ void testParse_WithVersion() {
+ PayloadsParserTester parser;
+ CPPUNIT_ASSERT(parser.parse("<query xmlns='jabber:iq:roster' ver='ver10'/>"));
+
+ RosterPayload* payload = dynamic_cast<RosterPayload*>(parser.getPayload().get());
+ CPPUNIT_ASSERT(payload->getVersion());
+ CPPUNIT_ASSERT_EQUAL(std::string("ver10"), *payload->getVersion());
+ }
+
+ void testParse_WithEmptyVersion() {
+ PayloadsParserTester parser;
+ CPPUNIT_ASSERT(parser.parse("<query xmlns='jabber:iq:roster' ver=''/>"));
+
+ RosterPayload* payload = dynamic_cast<RosterPayload*>(parser.getPayload().get());
+ CPPUNIT_ASSERT(payload->getVersion());
+ CPPUNIT_ASSERT_EQUAL(std::string(""), *payload->getVersion());
+ }
};
CPPUNIT_TEST_SUITE_REGISTRATION(RosterParserTest);
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/SearchPayloadParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/SearchPayloadParserTest.cpp
index 3d3bc7b..c07cd7f 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/SearchPayloadParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/SearchPayloadParserTest.cpp
@@ -7,8 +7,8 @@
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
-#include "Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h"
-#include "Swiften/Elements/SearchPayload.h"
+#include <Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h>
+#include <Swiften/Elements/SearchPayload.h>
using namespace Swift;
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/SecurityLabelParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/SecurityLabelParserTest.cpp
index 0812c6b..5083a07 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/SecurityLabelParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/SecurityLabelParserTest.cpp
@@ -7,8 +7,8 @@
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
-#include "Swiften/Parser/PayloadParsers/SecurityLabelParser.h"
-#include "Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h"
+#include <Swiften/Parser/PayloadParsers/SecurityLabelParser.h>
+#include <Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h>
using namespace Swift;
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/SecurityLabelsCatalogParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/SecurityLabelsCatalogParserTest.cpp
index e1e8594..395daf5 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/SecurityLabelsCatalogParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/SecurityLabelsCatalogParserTest.cpp
@@ -7,8 +7,8 @@
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
-#include "Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.h"
-#include "Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h"
+#include <Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.h>
+#include <Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h>
using namespace Swift;
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/SoftwareVersionParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/SoftwareVersionParserTest.cpp
index 3689f10..d22d207 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/SoftwareVersionParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/SoftwareVersionParserTest.cpp
@@ -7,8 +7,8 @@
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
-#include "Swiften/Parser/PayloadParsers/SoftwareVersionParser.h"
-#include "Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h"
+#include <Swiften/Parser/PayloadParsers/SoftwareVersionParser.h>
+#include <Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h>
using namespace Swift;
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/StatusParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/StatusParserTest.cpp
index 7791f5f..358ff88 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/StatusParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/StatusParserTest.cpp
@@ -7,8 +7,8 @@
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
-#include "Swiften/Parser/PayloadParsers/StatusParser.h"
-#include "Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h"
+#include <Swiften/Parser/PayloadParsers/StatusParser.h>
+#include <Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h>
using namespace Swift;
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/StatusShowParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/StatusShowParserTest.cpp
index 17617b4..924a87f 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/StatusShowParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/StatusShowParserTest.cpp
@@ -7,8 +7,8 @@
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
-#include "Swiften/Parser/PayloadParsers/StatusShowParser.h"
-#include "Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h"
+#include <Swiften/Parser/PayloadParsers/StatusShowParser.h>
+#include <Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h>
using namespace Swift;
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/StorageParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/StorageParserTest.cpp
index 88730b7..4fd8ae5 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/StorageParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/StorageParserTest.cpp
@@ -7,8 +7,8 @@
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
-#include "Swiften/Parser/PayloadParsers/StorageParser.h"
-#include "Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h"
+#include <Swiften/Parser/PayloadParsers/StorageParser.h>
+#include <Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h>
using namespace Swift;
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/StreamInitiationParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/StreamInitiationParserTest.cpp
index 8001487..47b2816 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/StreamInitiationParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/StreamInitiationParserTest.cpp
@@ -7,8 +7,8 @@
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
-#include "Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h"
-#include "Swiften/Elements/StreamInitiation.h"
+#include <Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h>
+#include <Swiften/Elements/StreamInitiation.h>
using namespace Swift;
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/VCardParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/VCardParserTest.cpp
index 909401d..f1e6635 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/VCardParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/VCardParserTest.cpp
@@ -4,13 +4,14 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Base/ByteArray.h"
+#include <Swiften/Base/ByteArray.h>
+#include <QA/Checker/IO.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
-#include "Swiften/Parser/PayloadParsers/VCardParser.h"
-#include "Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h"
+#include <Swiften/Parser/PayloadParsers/VCardParser.h>
+#include <Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h>
using namespace Swift;
@@ -93,7 +94,7 @@ class VCardParserTest : public CppUnit::TestFixture {
VCard* payload = dynamic_cast<VCard*>(parser.getPayload().get());
CPPUNIT_ASSERT_EQUAL(std::string("image/jpeg"), payload->getPhotoType());
- CPPUNIT_ASSERT_EQUAL(ByteArray("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890"), payload->getPhoto());
+ CPPUNIT_ASSERT_EQUAL(createByteArray("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890"), payload->getPhoto());
}
void testParse_Nickname() {
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/VCardUpdateParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/VCardUpdateParserTest.cpp
index b8ea4fb..fe69242 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/VCardUpdateParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/VCardUpdateParserTest.cpp
@@ -7,8 +7,8 @@
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
-#include "Swiften/Parser/PayloadParsers/VCardUpdateParser.h"
-#include "Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h"
+#include <Swiften/Parser/PayloadParsers/VCardUpdateParser.h>
+#include <Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h>
using namespace Swift;
diff --git a/Swiften/Parser/PayloadParsers/VCardParser.cpp b/Swiften/Parser/PayloadParsers/VCardParser.cpp
index 61af0ba..553d26a 100644
--- a/Swiften/Parser/PayloadParsers/VCardParser.cpp
+++ b/Swiften/Parser/PayloadParsers/VCardParser.cpp
@@ -4,10 +4,10 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/VCardParser.h"
-#include "Swiften/Base/foreach.h"
-#include "Swiften/StringCodecs/Base64.h"
-#include "Swiften/Parser/SerializingParser.h"
+#include <Swiften/Parser/PayloadParsers/VCardParser.h>
+#include <Swiften/Base/foreach.h>
+#include <Swiften/StringCodecs/Base64.h>
+#include <Swiften/Parser/SerializingParser.h>
namespace Swift {
diff --git a/Swiften/Parser/PayloadParsers/VCardParser.h b/Swiften/Parser/PayloadParsers/VCardParser.h
index c858e61..1475277 100644
--- a/Swiften/Parser/PayloadParsers/VCardParser.h
+++ b/Swiften/Parser/PayloadParsers/VCardParser.h
@@ -6,8 +6,8 @@
#pragma once
-#include "Swiften/Elements/VCard.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
+#include <Swiften/Elements/VCard.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
class SerializingParser;
diff --git a/Swiften/Parser/PayloadParsers/VCardParserFactory.h b/Swiften/Parser/PayloadParsers/VCardParserFactory.h
index 305d42e..8731c55 100644
--- a/Swiften/Parser/PayloadParsers/VCardParserFactory.h
+++ b/Swiften/Parser/PayloadParsers/VCardParserFactory.h
@@ -6,8 +6,8 @@
#pragma once
-#include "Swiften/Parser/GenericPayloadParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/VCardParser.h"
+#include <Swiften/Parser/GenericPayloadParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/VCardParser.h>
namespace Swift {
class VCardParserFactory : public GenericPayloadParserFactory<VCardParser> {
diff --git a/Swiften/Parser/PayloadParsers/VCardUpdateParser.cpp b/Swiften/Parser/PayloadParsers/VCardUpdateParser.cpp
index 2218d75..d4703da 100644
--- a/Swiften/Parser/PayloadParsers/VCardUpdateParser.cpp
+++ b/Swiften/Parser/PayloadParsers/VCardUpdateParser.cpp
@@ -4,7 +4,7 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Parser/PayloadParsers/VCardUpdateParser.h"
+#include <Swiften/Parser/PayloadParsers/VCardUpdateParser.h>
namespace Swift {
diff --git a/Swiften/Parser/PayloadParsers/VCardUpdateParser.h b/Swiften/Parser/PayloadParsers/VCardUpdateParser.h
index b91c17b..4954f0a 100644
--- a/Swiften/Parser/PayloadParsers/VCardUpdateParser.h
+++ b/Swiften/Parser/PayloadParsers/VCardUpdateParser.h
@@ -6,8 +6,8 @@
#pragma once
-#include "Swiften/Elements/VCardUpdate.h"
-#include "Swiften/Parser/GenericPayloadParser.h"
+#include <Swiften/Elements/VCardUpdate.h>
+#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
class SerializingParser;
diff --git a/Swiften/Parser/PayloadParsers/VCardUpdateParserFactory.h b/Swiften/Parser/PayloadParsers/VCardUpdateParserFactory.h
index 562f253..8a449fb 100644
--- a/Swiften/Parser/PayloadParsers/VCardUpdateParserFactory.h
+++ b/Swiften/Parser/PayloadParsers/VCardUpdateParserFactory.h
@@ -6,8 +6,8 @@
#pragma once
-#include "Swiften/Parser/GenericPayloadParserFactory.h"
-#include "Swiften/Parser/PayloadParsers/VCardUpdateParser.h"
+#include <Swiften/Parser/GenericPayloadParserFactory.h>
+#include <Swiften/Parser/PayloadParsers/VCardUpdateParser.h>
namespace Swift {
class VCardUpdateParserFactory : public GenericPayloadParserFactory<VCardUpdateParser> {