#include <xmpputils.h>
Public Types | |
enum | IqType { IqSet, IqGet, IqResult, IqError, IqCount } |
enum | CommandAction { CommExecute, CommCancel, CommPrev, CommNext, CommComplete } |
enum | CommandStatus { CommExecuting, CommCompleted, CommCancelled } |
Static Public Member Functions | |
static XMLElement * | createElement (const char *name, XMPPNamespace::Type ns, const char *text=0) |
static XMLElement * | createElement (XMLElement::Type type, XMPPNamespace::Type ns, const char *text=0) |
static XMLElement * | createIq (IqType type, const char *from, const char *to, const char *id) |
static XMLElement * | createIqBind (const char *from, const char *to, const char *id, const ObjList &resources) |
static XMLElement * | createCommand (CommandAction action, const char *node, const char *sessionId=0) |
static XMLElement * | createIdentity (const char *category, const char *type, const char *name) |
static XMLElement * | createIqDisco (const char *from, const char *to, const char *id, bool info=true) |
static XMLElement * | createDiscoInfoRes (const char *from, const char *to, const char *id, JIDFeatureList *features, JIDIdentity *identity) |
static XMLElement * | createError (XMPPError::ErrorType type, XMPPError::Type error, const char *text=0) |
static XMLElement * | createError (XMLElement *xml, XMPPError::ErrorType type, XMPPError::Type error, const char *text=0) |
static XMLElement * | createStreamError (XMPPError::Type error, const char *text=0) |
static bool | hasXmlns (XMLElement &element, XMPPNamespace::Type ns) |
static void | decodeError (XMLElement *element, String &error, String &text) |
static void | print (String &xmlStr, XMLElement &element, const char *indent=0) |
static bool | split (NamedList &dest, const char *src, const char sep, bool nameFirst) |
static int | decodeFlags (const String &src, const TokenDict *dict) |
static void | buildFlags (String &dest, int src, const TokenDict *dict) |
static bool | addChidren (XMLElement *dest, ObjList &list) |
static IqType | iqType (const char *text) |
Static Public Attributes | |
static TokenDict | s_iq [] |
static TokenDict | s_commandAction [] |
static TokenDict | s_commandStatus [] |
This class is a general XMPP utilities
enum CommandAction |
Command action enumeration
enum CommandStatus |
Command status enumeration
enum IqType |
Iq type enumeration
static bool addChidren | ( | XMLElement * | dest, | |
ObjList & | list | |||
) | [static] |
Add child elements from a list to a destination element
dest | Destination XMLElement | |
list | A list containing XML elements |
Encode a mask of flags to a comma separated list of names
dest | Destination string | |
src | Source mask | |
dict | Dictionary containing flag names and values |
static XMLElement* createCommand | ( | CommandAction | action, | |
const char * | node, | |||
const char * | sessionId = 0 | |||
) | [static] |
Create a 'command' element
action | The command action | |
node | The command | |
sessionId | Optional session ID for the command |
static XMLElement* createDiscoInfoRes | ( | const char * | from, | |
const char * | to, | |||
const char * | id, | |||
JIDFeatureList * | features, | |||
JIDIdentity * | identity | |||
) | [static] |
Create an 'iq' of type 'result' element with a 'query' child in response to a disco info request
from | The 'from' attribute | |
to | The 'to' attribute | |
id | The 'id' attribute | |
features | Features to be added to response | |
identity | The identity of the entity sending the response |
Referenced by XMPPUserRoster::createDiscoInfoResult().
static XMLElement* createElement | ( | XMLElement::Type | type, | |
XMPPNamespace::Type | ns, | |||
const char * | text = 0 | |||
) | [static] |
Create an XML element with an 'xmlns' attribute
type | Element's type | |
ns | 'xmlns' attribute | |
text | Optional text for the element |
static XMLElement* createElement | ( | const char * | name, | |
XMPPNamespace::Type | ns, | |||
const char * | text = 0 | |||
) | [static] |
Create an XML element with an 'xmlns' attribute
name | Element's name | |
ns | 'xmlns' attribute | |
text | Optional text for the element |
static XMLElement* createError | ( | XMLElement * | xml, | |
XMPPError::ErrorType | type, | |||
XMPPError::Type | error, | |||
const char * | text = 0 | |||
) | [static] |
Create an error from a received element. Consume the received element Reverse 'to' and 'from' attributes
xml | Received element | |
type | Error type | |
error | The error | |
text | Optional text to add to the error element |
static XMLElement* createError | ( | XMPPError::ErrorType | type, | |
XMPPError::Type | error, | |||
const char * | text = 0 | |||
) | [static] |
Create a 'error' element
type | Error type | |
error | The error | |
text | Optional text to add to the error element |
static XMLElement* createIdentity | ( | const char * | category, | |
const char * | type, | |||
const char * | name | |||
) | [static] |
Create an 'identity' element
category | The 'category' attribute | |
type | The 'type' attribute | |
name | The 'name' attribute |
static XMLElement* createIq | ( | IqType | type, | |
const char * | from, | |||
const char * | to, | |||
const char * | id | |||
) | [static] |
Create an 'iq' element
type | Iq type as enumeration | |
from | The 'from' attribute | |
to | The 'to' attribute | |
id | The 'id' attribute |
static XMLElement* createIqBind | ( | const char * | from, | |
const char * | to, | |||
const char * | id, | |||
const ObjList & | resources | |||
) | [static] |
Create an 'iq' element with a 'bind' child containing the resources
from | The 'from' attribute | |
to | The 'to' attribute | |
id | The 'id' attribute | |
resources | The resources to bind (strings) |
static XMLElement* createIqDisco | ( | const char * | from, | |
const char * | to, | |||
const char * | id, | |||
bool | info = true | |||
) | [static] |
Create an 'iq' of type 'get' element with a 'query' child
from | The 'from' attribute | |
to | The 'to' attribute | |
id | The 'id' attribute | |
info | True to create a query info request. False to create a query items request |
static XMLElement* createStreamError | ( | XMPPError::Type | error, | |
const char * | text = 0 | |||
) | [static] |
Create a 'stream:error' element
error | The XMPP defined condition | |
text | Optional text to add to the error |
static void decodeError | ( | XMLElement * | element, | |
String & | error, | |||
String & | text | |||
) | [static] |
Decode a received stream error or stanza error
element | The received element | |
error | The error condition | |
text | The stanza's error or error text |
Decode a comma separated list of flags and put them into an integer mask
src | Source string | |
dict | Dictionary containing flag names and values |
static bool hasXmlns | ( | XMLElement & | element, | |
XMPPNamespace::Type | ns | |||
) | [static] |
Check if the given element has an attribute 'xmlns' equal to a given value
element | Element to check | |
ns | Namespace value to check |
static IqType iqType | ( | const char * | text | ) | [inline, static] |
Get the type of an 'iq' stanza as enumeration
text | The text to check |
References TelEngine::lookup().
static void print | ( | String & | xmlStr, | |
XMLElement & | element, | |||
const char * | indent = 0 | |||
) | [static] |
Print an XMLElement to a string
xmlStr | The destination string | |
element | The element to print | |
indent | The indent. 0 if it is the root element |
static bool split | ( | NamedList & | dest, | |
const char * | src, | |||
const char | sep, | |||
bool | nameFirst | |||
) | [static] |
Split a string at a delimiter character and fills a named list with its parts Skip empty parts
dest | The destination NamedList | |
src | Pointer to the string | |
sep | The delimiter | |
nameFirst | True to add the parts as name and index as value. False to do the other way |
TokenDict s_commandAction[] [static] |
Keep the command actions
TokenDict s_commandStatus[] [static] |
Keep the command status