diff options
Diffstat (limited to 'Swiften/Elements/Stanza.h')
-rw-r--r-- | Swiften/Elements/Stanza.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Swiften/Elements/Stanza.h b/Swiften/Elements/Stanza.h index aa1cf4f..f42048e 100644 --- a/Swiften/Elements/Stanza.h +++ b/Swiften/Elements/Stanza.h @@ -32,6 +32,19 @@ namespace Swift { return boost::shared_ptr<T>(); } + template<typename T> + std::vector< boost::shared_ptr<T> > getPayloads() const { + std::vector< boost::shared_ptr<T> > results; + foreach (const boost::shared_ptr<Payload>& i, payloads_) { + boost::shared_ptr<T> result(boost::dynamic_pointer_cast<T>(i)); + if (result) { + results.push_back(result); + } + } + return results; + } + + const std::vector< boost::shared_ptr<Payload> >& getPayloads() const { return payloads_; } |