#include <error.h>
A stanza error abstraction implemented as a StanzaExtension.
- Author
- Vincent Thomasset
-
Jakob Schröter js@ca.nosp@m.maya.nosp@m..net
- Since
- 1.0
Definition at line 34 of file error.h.
◆ Error() [1/2]
Creates a new Error object from the given Tag.
- Parameters
-
Definition at line 67 of file error.cpp.
◆ Error() [2/2]
Creates a new Error object.
- Parameters
-
type | The error type. |
error | The actual stanza error. |
appError | An optional application-specific error. |
Definition at line 55 of file error.h.
◆ ~Error()
Virtual destructor.
Definition at line 94 of file error.cpp.
◆ appError()
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.
◆ clone()
◆ error()
Return the stanza error.
- Returns
- The actual error.
Definition at line 75 of file error.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 99 of file error.cpp.
◆ newInstance()
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 );
}
virtual Tag * tag() const
StanzaExtension(int type)
- Returns
- The derived extension's new instance.
Implements StanzaExtension.
Definition at line 118 of file error.h.
◆ setAppError()
void setAppError |
( |
Tag * |
appError | ) |
|
Sets the application-specific error condition of a stanza error.
- Parameters
-
appError | The application-specific error element of a stanza error. The Error object will own and delete the Tag. |
Definition at line 138 of file error.cpp.
◆ setText()
void setText |
( |
const std::string & |
text, |
|
|
const std::string & |
lang = EmptyString |
|
) |
| |
|
inline |
Sets the text of a error stanza for the given language.
- Parameters
-
text | The error text to set. |
lang | The 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 109 of file error.h.
◆ tag()
◆ text()
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
-
lang | The 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.
◆ type()
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: