gloox
1.0
|
00001 /* 00002 Copyright (c) 2007-2009 by Jakob Schroeter <js@camaya.net> 00003 This file is part of the gloox library. http://camaya.net/gloox 00004 00005 This software is distributed under a license. The full license 00006 agreement can be found in the file LICENSE in this distribution. 00007 This software may not be copied, modified, sold or distributed 00008 other than expressed in the named license agreement. 00009 00010 This software is distributed without any warranty. 00011 */ 00012 00013 #ifndef SHIM_H__ 00014 #define SHIM_H__ 00015 00016 #include "stanzaextension.h" 00017 #include "macros.h" 00018 00019 #include <map> 00020 #include <string> 00021 00022 namespace gloox 00023 { 00024 00025 class Tag; 00026 00035 class GLOOX_API SHIM : public StanzaExtension 00036 { 00037 public: 00041 typedef std::map<std::string, std::string> HeaderList; 00042 00047 SHIM( const HeaderList& hl ); 00048 00053 SHIM( const Tag* tag = 0 ); 00054 00059 const HeaderList& headers() const { return m_headers; } 00060 00064 virtual ~SHIM(); 00065 00066 // re-implemented from StanzaExtension 00067 virtual const std::string& filterString() const; 00068 00069 // re-implemented from StanzaExtension 00070 virtual StanzaExtension* newInstance( const Tag* tag ) const 00071 { 00072 return new SHIM( tag ); 00073 } 00074 00075 // re-implemented from StanzaExtension 00076 virtual Tag* tag() const; 00077 00078 // reimplemented from StanzaExtension 00079 virtual StanzaExtension* clone() const 00080 { 00081 return new SHIM( *this ); 00082 } 00083 00084 private: 00085 HeaderList m_headers; 00086 00087 }; 00088 00089 } 00090 00091 #endif // SHIM_H__