gloox  1.0
Public Member Functions | List of all members
Disco::Info Class Reference

#include <disco.h>

Inheritance diagram for Disco::Info:
Inheritance graph
[legend]

Public Member Functions

const std::string & node () const
const StringListfeatures () const
bool hasFeature (const std::string &feature) const
const IdentityListidentities () const
const DataFormform () const
void setForm (DataForm *form)
virtual const std::string & filterString () const
virtual StanzaExtensionnewInstance (const Tag *tag) const
virtual StanzaExtensionclone () const
virtual Tagtag () const
- Public Member Functions inherited from StanzaExtension
 StanzaExtension (int type)
virtual ~StanzaExtension ()
int extensionType () const

Detailed Description

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

Author
Jakob Schroeter js@ca.nosp@m.maya.nosp@m..net
Since
1.0

Definition at line 65 of file disco.h.

Member Function Documentation

virtual StanzaExtension* clone ( ) const
inlinevirtual

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.

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.

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.

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.

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

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

Parameters
featureThe feature to check for.
Returns
True if the entity announces support for the feature, false otherwise.

Definition at line 121 of file disco.cpp.

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.

virtual StanzaExtension* newInstance ( const Tag tag) const
inlinevirtual

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

{
return new FooExtension( tag );
}
Returns
The derived extension's new instance.

Implements StanzaExtension.

Definition at line 114 of file disco.h.

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.

void setForm ( DataForm form)

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

Parameters
formAn 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 ( ) 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: