gloox  1.1-svn
bob.h
1 /*
2  Copyright (c) 2009 by Jakob Schroeter <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 
14 
15 #ifndef BOB_H__
16 #define BOB_H__
17 
18 
19 #include "stanzaextension.h"
20 
21 #include <string>
22 
23 namespace gloox
24 {
25 
26  class Tag;
27 
35  class GLOOX_API BOB : public StanzaExtension
36  {
37 
38  public:
43  BOB( const Tag* tag = 0 );
44 
63  BOB( const std::string& cid, const std::string& type,
64  const std::string& data, int maxage );
65 
69  virtual ~BOB() {}
70 
75  const std::string data() const;
76 
81  const std::string cid() const { return m_cid; }
82 
87  const std::string& type() const { return m_type; }
88 
93  int maxage() const { return m_maxage; }
94 
95  // reimplemented from StanzaExtension
96  virtual const std::string& filterString() const;
97 
98  // reimplemented from StanzaExtension
99  virtual StanzaExtension* newInstance( const Tag* tag ) const
100  {
101  return new BOB( tag );
102  }
103 
104  // reimplemented from StanzaExtension
105  virtual Tag* tag() const;
106 
107  // reimplemented from StanzaExtension
108  virtual StanzaExtension* clone() const
109  {
110  return new BOB();
111  }
112 
113  private:
114  std::string m_cid;
115  std::string m_type;
116  std::string m_data;
117  int m_maxage;
118 
119  };
120 
121 }
122 
123 #endif // BOB_H__