gloox  1.0.28
shim.h
1 /*
2  Copyright (c) 2007-2023 by Jakob Schröter <js@camaya.net>
3  This file is part of the gloox library. http://camaya.net/gloox
4 
5  This software is distributed under a license. The full license
6  agreement can be found in the file LICENSE in this distribution.
7  This software may not be copied, modified, sold or distributed
8  other than expressed in the named license agreement.
9 
10  This software is distributed without any warranty.
11 */
12 
13 #ifndef SHIM_H__
14 #define SHIM_H__
15 
16 #include "stanzaextension.h"
17 #include "macros.h"
18 
19 #include <map>
20 #include <string>
21 
22 namespace gloox
23 {
24 
25  class Tag;
26 
35  class GLOOX_API SHIM : public StanzaExtension
36  {
37  public:
41  typedef std::map<std::string, std::string> HeaderList;
42 
47  SHIM( const HeaderList& hl );
48 
53  SHIM( const Tag* tag = 0 );
54 
59  const HeaderList& headers() const { return m_headers; }
60 
64  virtual ~SHIM();
65 
66  // re-implemented from StanzaExtension
67  virtual const std::string& filterString() const;
68 
69  // re-implemented from StanzaExtension
70  virtual StanzaExtension* newInstance( const Tag* tag ) const
71  {
72  return new SHIM( tag );
73  }
74 
75  // re-implemented from StanzaExtension
76  virtual Tag* tag() const;
77 
78  // reimplemented from StanzaExtension
79  virtual StanzaExtension* clone() const
80  {
81  return new SHIM( *this );
82  }
83 
84  private:
85  HeaderList m_headers;
86 
87  };
88 
89 }
90 
91 #endif // SHIM_H__
An implementation/abstraction of Stanza Headers and Internet Metadata (SHIM, XEP-0131).
Definition: shim.h:36
std::map< std::string, std::string > HeaderList
Definition: shim.h:41
virtual StanzaExtension * newInstance(const Tag *tag) const
Definition: shim.h:70
const HeaderList & headers() const
Definition: shim.h:59
virtual StanzaExtension * clone() const
Definition: shim.h:79
This class abstracts a stanza extension, which is usually an XML child element in a specific namespac...
This is an abstraction of an XML element.
Definition: tag.h:47
The namespace for the gloox library.
Definition: adhoc.cpp:28