Disco::Info Class Reference

`#include <disco.h>`

Inheritance diagram for Disco::Info:
[legend]

## Public Member Functions

const std::string & | node () const
const StringList & | features () const
bool | hasFeature (const std::string &feature) const
const IdentityList & | identities () const
const DataForm * | form () const
void | setForm (DataForm *form)
virtual const std::string & | filterString () const
virtual StanzaExtension * | newInstance (const Tag *tag) const
virtual StanzaExtension * | clone () const
virtual Tag * | tag () const
Public Member Functions inherited from StanzaExtension
| StanzaExtension (int type)
virtual | ~StanzaExtension ()
virtual Stanza * | embeddedStanza () const
virtual Tag * | embeddedTag () const
int | extensionType () const

## Detailed Description

An abstraction of a Disco Info element (from Service Discovery, XEP-0030) as a StanzaExtension.

Author
  Jakob Schröter js@ca.nosp@m.maya.nosp@m..net

Since
  1.0

Definition at line 65 of file disco.h.

## Member Function Documentation

## clone()

virtual StanzaExtension * clone | ( |  | ) | const

inline virtual

Returns an identical copy of the current StanzaExtension.

Returns
  An identical copy of the current StanzaExtension.

Implements StanzaExtension.

Definition at line 120 of file disco.h.

## features()

const StringList & features | ( |  | ) | const

inline

Returns the entity's supported features.

Returns
  A list of supported features/namespaces.

Definition at line 80 of file disco.h.

## filterString()

const std::string & filterString | ( |  | ) | const

virtual

Returns an XPath expression that describes a path to child elements of a stanza that an extension handles.

Returns
  The extension's filter string.

Implements StanzaExtension.

Definition at line 129 of file disco.cpp.

## form()

const DataForm * form | ( |  | ) | const

inline

Returns an optionally included data form. This is used by e.g. MUC (XEP-0045).

Returns
  An optional data form included in the disco#info. May be 0.

Definition at line 99 of file disco.h.

## hasFeature()

bool hasFeature | ( | const std::string & | feature | ) | const

Use this function to check if the entity the Info came from supports agiven feature.

Parameters

  feature | The feature to check for.

Returns
  True if the entity announces support for the feature, false otherwise.

Definition at line 121 of file disco.cpp.

## identities()

const IdentityList & identities | ( |  | ) | const

inline

Returns the entity's identities.

Returns
  A list of pointers to Identity objects.

Definition at line 93 of file disco.h.

## newInstance()

virtual StanzaExtension * newInstance | ( | const Tag * | tag | ) | const

inline virtual

Returns a new Instance of the derived type. Usually, for a derived class FooExtension, the implementation of this function looks like:

StanzaExtension* FooExtension::newInstance( const Tag* tag ) const
{
return new FooExtension( tag );
}
gloox::Disco::Info::tag
virtual Tag * tag() const
Definition disco.cpp:135
gloox::StanzaExtension::StanzaExtension
StanzaExtension(int type)
Definition stanzaextension.h:211
gloox::Tag
This is an abstraction of an XML element.
Definition tag.h:47

Returns
  The derived extension's new instance.

Implements StanzaExtension.

Definition at line 114 of file disco.h.

## node()

const std::string & node | ( |  | ) | const

inline

Returns the queried node identifier, if any.

Returns
  The node identifier. May be empty.

Definition at line 74 of file disco.h.

## setForm()

void setForm | ( | DataForm * | form | ) |

Adds an optional DataForm, e.g. for XEP-0232. Only one form can be added at this point.

Parameters

  form | An optional DataForm to include in the Info reply. The form will be owned by and deleted on destruction of the Info object.

Note
  If called more than once the previously set form will be deleted.

Definition at line 115 of file disco.cpp.

## tag()

Tag * tag | ( |  | ) | const

virtual

Returns a Tag representation of the extension.

Returns
  A Tag representation of the extension.

Implements StanzaExtension.

Definition at line 135 of file disco.cpp.

The documentation for this class was generated from the following files:

- disco.h
- disco.cpp