nickname.h
/*
Copyright (c) 2007-2023 by Jakob Schröter <js@camaya.net>
This file is part of the gloox library. http://camaya.net/gloox
This software is distributed under a license. The full license
agreement can be found in the file LICENSE in this distribution.
This software may not be copied, modified, sold or distributed
other than expressed in the named license agreement.
This software is distributed without any warranty.
*/
#ifndef NICKNAME_H__
#define NICKNAME_H__
#include "gloox.h"
#include "stanzaextension.h"
#include <string>
namespace gloox
{
class Tag;
class GLOOX_API Nickname : public StanzaExtension
{
public:
Nickname( const Tag* tag );
Nickname( const std::string& nick )
: StanzaExtension( ExtNickname ), m_nick( nick )
{}
virtual ~Nickname() {}
const std::string nick() const { return m_nick; }
// reimplemented from StanzaExtension
virtual const std::string& filterString() const;
// reimplemented from StanzaExtension
virtual StanzaExtension* newInstance( const Tag* tag ) const
{
return new Nickname( tag );
}
// reimplemented from StanzaExtension
Tag* tag() const;
// reimplemented from StanzaExtension
virtual StanzaExtension* clone() const
{
return new Nickname( *this );
}
private:
std::string m_nick;
};
}
#endif // NICKNAME_H__
gloox::Nickname::clone
virtual StanzaExtension * clone() const
Definition nickname.h:75
gloox::Nickname::~Nickname
virtual ~Nickname()
Definition nickname.h:54
gloox::Nickname::newInstance
virtual StanzaExtension * newInstance(const Tag *tag) const
Definition nickname.h:66
gloox::Nickname::Nickname
Nickname(const Tag *tag)
Definition nickname.cpp:19
gloox::Nickname::Nickname
Nickname(const std::string &nick)
Definition nickname.h:47
gloox::Nickname::tag
Tag * tag() const
Definition nickname.cpp:34
gloox::Nickname::nick
const std::string nick() const
Definition nickname.h:60
gloox::StanzaExtension::StanzaExtension
StanzaExtension(int type)
Definition stanzaextension.h:211
gloox::Tag
This is an abstraction of an XML element.
Definition tag.h:47
gloox
The namespace for the gloox library.
Definition adhoc.cpp:28
gloox::ExtNickname
@ ExtNickname
Definition stanzaextension.h:53