• Main Page
  • Classes
  • Files
  • File List

Swiften/Elements/Storage.h

00001 /*
00002  * Copyright (c) 2010 Remko Tronçon
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 
00011 #include <boost/optional.hpp>
00012 
00013 #include <Swiften/Elements/Payload.h>
00014 #include <string>
00015 #include <Swiften/JID/JID.h>
00016 #include <Swiften/Base/SafeString.h>
00017 
00018 namespace Swift {
00019   class Storage : public Payload {
00020     public:
00021       struct Room {
00022         Room() : autoJoin(false) {}
00023 
00024         std::string name;
00025         JID jid;
00026         bool autoJoin;
00027         std::string nick;
00028         boost::optional<std::string> password;
00029       };
00030 
00031       struct URL {
00032         URL() {}
00033 
00034         std::string name;
00035         std::string url;
00036       };
00037 
00038       Storage() {
00039       }
00040 
00041       
00042       void clearRooms() {
00043         rooms.clear();
00044       }
00045 
00046       const std::vector<Room>& getRooms() const {
00047         return rooms;
00048       }
00049 
00050       void addRoom(const Room& room) {
00051         rooms.push_back(room);
00052       }
00053 
00054       const std::vector<URL>& getURLs() const {
00055         return urls;
00056       }
00057 
00058       void addURL(const URL& url) {
00059         urls.push_back(url);
00060       }
00061 
00062     private:
00063       std::vector<Room> rooms;
00064       std::vector<URL> urls;
00065   };
00066 }

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