• Main Page
  • Classes
  • Files
  • File List

Swiften/Avatars/DummyAvatarManager.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 <map>
00010 
00011 #include <Swiften/JID/JID.h>
00012 #include <Swiften/Avatars/AvatarManager.h>
00013 
00014 namespace Swift {
00015   class DummyAvatarManager : public AvatarManager {
00016     public:
00017       virtual boost::filesystem::path getAvatarPath(const JID& j) const {
00018         return boost::filesystem::path("/avatars") / j.toString();
00019       }
00020 
00021       virtual ByteArray getAvatar(const JID& jid) const {
00022         std::map<JID, ByteArray>::const_iterator i = avatars.find(jid);
00023         if (i != avatars.end()) {
00024           return i->second;
00025         }
00026         else {
00027           return ByteArray();
00028         }
00029       }
00030 
00031       std::map<JID, ByteArray> avatars;
00032   };
00033 }

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