gloox  1.0.28
softwareversion.h
1 /*
2  Copyright (c) 2008-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 
14 
15 #ifndef SOFTWAREVERSION_H__
16 #define SOFTWAREVERSION_H__
17 
18 
19 #include "stanzaextension.h"
20 
21 #include <string>
22 
23 namespace gloox
24 {
25 
26  class Tag;
27 
34  class GLOOX_API SoftwareVersion : public StanzaExtension
35  {
36 
37  public:
44  SoftwareVersion( const std::string& name, const std::string& version, const std::string& os );
45 
50  SoftwareVersion( const Tag* tag = 0 );
51 
55  virtual ~SoftwareVersion();
56 
61  const std::string& name() const { return m_name; }
62 
67  const std::string& version() const { return m_version; }
68 
73  const std::string& os() const { return m_os; }
74 
75  // reimplemented from StanzaExtension
76  virtual const std::string& filterString() const;
77 
78  // reimplemented from StanzaExtension
79  virtual StanzaExtension* newInstance( const Tag* tag ) const
80  {
81  return new SoftwareVersion( tag );
82  }
83 
84  // reimplemented from StanzaExtension
85  virtual Tag* tag() const;
86 
87  // reimplemented from StanzaExtension
88  virtual StanzaExtension* clone() const
89  {
90  return new SoftwareVersion( *this );
91  }
92 
93  private:
94  std::string m_name;
95  std::string m_version;
96  std::string m_os;
97  };
98 
99 }
100 
101 #endif// SOFTWAREVERSION_H__
This is an implementation of XEP-0092 as a StanzaExtension.
const std::string & version() const
virtual StanzaExtension * newInstance(const Tag *tag) const
const std::string & name() const
virtual StanzaExtension * clone() const
const std::string & os() const
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