gloox  1.0.1
Public Member Functions | List of all members
Error Class Reference

#include <error.h>

Inheritance diagram for Error:
Inheritance graph
[legend]

Public Member Functions

 Error (const Tag *tag=0)
 Error (StanzaErrorType type, StanzaError error, Tag *appError=0)
virtual ~Error ()
StanzaErrorType type () const
StanzaError error () const
const TagappError () const
const std::string & text (const std::string &lang=EmptyString) const
void setText (const std::string &text, const std::string &lang=EmptyString)
virtual const std::string & filterString () const
virtual StanzaExtensionnewInstance (const Tag *tag) const
virtual Tagtag () const
virtual StanzaExtensionclone () const
- Public Member Functions inherited from StanzaExtension
 StanzaExtension (int type)
virtual ~StanzaExtension ()
int extensionType () const

Detailed Description

A stanza error abstraction implemented as a StanzaExtension.

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

Definition at line 34 of file error.h.

Constructor & Destructor Documentation

Error ( const Tag tag = 0)

Creates a new Error object from the given Tag.

Parameters
tagThe Tag to parse.

Definition at line 67 of file error.cpp.

Error ( StanzaErrorType  type,
StanzaError  error,
Tag appError = 0 
)
inline

Creates a new Error object.

Parameters
typeThe error type.
errorThe actual stanza error.
appErrorAn optional application-specific error.

Definition at line 55 of file error.h.

~Error ( )
virtual

Virtual destructor.

Definition at line 94 of file error.cpp.

Member Function Documentation

const Tag* appError ( ) const
inline

This function can be used to retrieve the application-specific error condition of a stanza error.

Returns
The application-specific error element of a stanza error. 0 if no respective element was found or no error occured.

Definition at line 83 of file error.h.

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 121 of file error.h.

StanzaError error ( ) const
inline

Return the stanza error.

Returns
The actual error.

Definition at line 75 of file error.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 99 of file error.cpp.

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 112 of file error.h.

void setText ( const std::string &  text,
const std::string &  lang = EmptyString 
)
inline

Sets the text of a error stanza for the given language.

Parameters
textThe error text to set.
langThe language identifier for the desired language. It must conform to section 2.12 of the XML specification and RFC 3066. If empty, the default text will be set.

Definition at line 103 of file error.h.

Tag * tag ( ) const
virtual

Returns a Tag representation of the extension.

Returns
A Tag representation of the extension.

Implements StanzaExtension.

Definition at line 109 of file error.cpp.

const std::string & text ( const std::string &  lang = EmptyString) const

Returns the text of a error stanza for the given language if available. If the requested language is not available, the default text (without a xml:lang attribute) will be returned.

Parameters
langThe language identifier for the desired language. It must conform to section 2.12 of the XML specification and RFC 3066. If empty, the default text will be returned, if any.
Returns
The text of an error stanza.

Definition at line 132 of file error.cpp.

StanzaErrorType type ( ) const
inline

Returns the error type.

Returns
The error type.

Definition at line 69 of file error.h.


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