summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h')
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h b/Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h
index 9ce0ac4..ee64181 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h
+++ b/Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h
@@ -12,6 +12,8 @@
#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 {
@@ -52,6 +54,11 @@ namespace Swift {
return payloadParser->getPayload();
}
+ template<typename T>
+ boost::shared_ptr<T> getPayload() const {
+ return boost::dynamic_pointer_cast<T>(payloadParser->getPayload());
+ }
+
private:
XMLParser* xmlParser;
FullPayloadParserFactoryCollection factories;