• Main Page
  • Classes
  • Files
  • File List

Swiften/Elements/DiscoItems.h

00001 /*
00002  * Copyright (c) 2010 Kevin Smith
00003  * Licensed under the GNU General Public License v3.
00004  * See Documentation/Licenses/GPLv3.txt for more information.
00005  */
00006 
00007 #pragma once
00008 
00009 #include <vector>
00010 #include <string>
00011 
00012 #include <Swiften/Elements/Payload.h>
00013 #include <Swiften/JID/JID.h>
00014 
00015 namespace Swift {
00019   class DiscoItems : public Payload {
00020     public:
00024       class Item {
00025         public:
00026           Item(const std::string& name, const JID& jid, const std::string& node="") : name_(name), jid_(jid), node_(node) {
00027           }
00028 
00029           const std::string& getName() const {
00030             return name_;
00031           }
00032 
00033           const std::string& getNode() const {
00034             return node_;
00035           }         
00036 
00037           const JID& getJID() const {
00038             return jid_;
00039           }
00040 
00041         private:
00042           std::string name_;
00043           JID jid_;
00044           std::string node_;
00045       };
00046 
00047       DiscoItems() {
00048       }
00049 
00050       const std::string& getNode() const {
00051         return node_;
00052       }
00053 
00054       void setNode(const std::string& node) {
00055         node_ = node;
00056       }
00057 
00058       const std::vector<Item>& getItems() const {
00059         return items_;
00060       }
00061 
00062       void addItem(const Item& item) {
00063         items_.push_back(item);
00064       }
00065 
00066     private:
00067       std::string node_;
00068       std::vector<Item> items_;
00069   };
00070 }

Generated on Fri Oct 12 2012 21:00:19 for Swiften by  doxygen 1.7.1