|
|
This class is a general XMPP utilities
enum IqType { IqSet, IqGet, IqResult, IqError, IqCount, } | IqType |
Iq type enumeration
enum CommandAction { CommExecute, CommCancel, CommPrev, CommNext, CommComplete, } | CommandAction |
Command action enumeration
enum CommandStatus { CommExecuting, CommCompleted, CommCancelled, } | CommandStatus |
Command status enumeration
XMLElement* createElement (const char* name, XMPPNamespace::Type ns,
const char* text = 0)
| createElement |
[static]
Create an XML element with an 'xmlns' attribute
Parameters:
name | Element's name |
ns | 'xmlns' attribute |
text | Optional text for the element |
Returns: A valid XMLElement pointer
XMLElement* createElement (XMLElement::Type type, XMPPNamespace::Type ns,
const char* text = 0)
| createElement |
[static]
Create an XML element with an 'xmlns' attribute
Parameters:
type | Element's type |
ns | 'xmlns' attribute |
text | Optional text for the element |
Returns: A valid XMLElement pointer
XMLElement* createIq (IqType type, const char* from,
const char* to, const char* id)
| createIq |
[static]
Create an 'iq' element
Parameters:
type | Iq type as enumeration |
from | The 'from' attribute |
to | The 'to' attribute |
id | The 'id' attribute |
Returns: A valid XMLElement pointer
XMLElement* createIqBind (const char* from,
const char* to, const char* id, const ObjList& resources)
| createIqBind |
[static]
Create an 'iq' element with a 'bind' child containing the resources
Parameters:
from | The 'from' attribute |
to | The 'to' attribute |
id | The 'id' attribute |
resources | The resources to bind (strings) |
Returns: A valid XMLElement pointer
XMLElement* createVCard (bool get, const char* from, const char* to, const char* id)
| createVCard |
[static]
Create an 'iq' element with a 'vcard' child
Parameters:
get | True to set the iq's type to 'get', false to set it to 'set' |
from | The 'from' attribute |
to | The 'to' attribute |
id | The 'id' attribute |
Returns: A valid XMLElement pointer
XMLElement* createCommand (CommandAction action, const char* node,
const char* sessionId = 0)
| createCommand |
[static]
Create a 'command' element
Parameters:
action | The command action |
node | The command |
sessionId | Optional session ID for the command |
Returns: A valid XMLElement pointer
XMLElement* createIdentity (const char* category,
const char* type, const char* name)
| createIdentity |
[static]
Create an 'identity' element
Parameters:
category | The 'category' attribute |
type | The 'type' attribute |
name | The 'name' attribute |
Returns: A valid XMLElement pointer
XMLElement* createIqDisco (const char* from, const char* to,
const char* id, bool info = true)
| createIqDisco |
[static]
Create an 'iq' of type 'get' element with a 'query' child
Parameters:
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 |
Returns: A valid XMLElement pointer
XMLElement* createDiscoInfoRes (const char* from, const char* to,
const char* id, JIDFeatureList* features, JIDIdentity* identity)
| createDiscoInfoRes |
[static]
Create an 'iq' of type 'result' element with a 'query' child in response to a disco info request
Parameters:
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 |
Returns: A valid XMLElement pointer
XMLElement* createError (XMPPError::ErrorType type,
XMPPError::Type error, const char* text = 0)
| createError |
[static]
Create a 'error' element
Parameters:
type | Error type |
error | The error |
text | Optional text to add to the error element |
Returns: A valid XMLElement pointer
XMLElement* createError (XMLElement* xml, XMPPError::ErrorType type,
XMPPError::Type error, const char* text = 0)
| createError |
[static]
Create an error from a received element. Consume the received element Reverse 'to' and 'from' attributes
Parameters:
xml | Received element |
type | Error type |
error | The error |
text | Optional text to add to the error element |
Returns: A valid XMLElement pointer or 0 if xml is 0
XMLElement* createStreamError (XMPPError::Type error,
const char* text = 0)
| createStreamError |
[static]
Create a 'stream:error' element
Parameters:
error | The XMPP defined condition |
text | Optional text to add to the error |
Returns: A valid XMLElement pointer
XMLElement* createRegisterQuery (IqType type, const char* from,
const char* to, const char* id,
XMLElement* child1 = 0, XMLElement* child2 = 0, XMLElement* child3 = 0)
| createRegisterQuery |
[static]
Build a register query element
Parameters:
type | Iq type as enumeration |
from | The 'from' attribute |
to | The 'to' attribute |
id | The 'id' attribute |
child1 | Optional child of query element |
child2 | Optional child of query element |
child3 | Optional child of query element |
Returns: Valid XMLElement pointer
inline XMLElement* createRegisterQuery (const char* from,
const char* to, const char* id,
const char* username, const char* password)
| createRegisterQuery |
[static]
Build an register query element used to create/set username/password
Parameters:
from | The 'from' attribute |
to | The 'to' attribute |
id | The 'id' attribute |
username | The username |
password | The password |
Returns: Valid XMLElement pointer
bool hasXmlns (XMLElement& element, XMPPNamespace::Type ns)
| hasXmlns |
[static]
Check if the given element has an attribute 'xmlns' equal to a given value
Parameters:
element | Element to check |
ns | Namespace value to check |
Returns: True if the given element has the requested namespace
void decodeError (XMLElement* element, String& error, String& text)
| decodeError |
[static]
Decode a received stream error or stanza error
Parameters:
element | The received element |
error | The error condition |
text | The stanza's error or error text |
void encodeDateTimeSec (String& buf, unsigned int timeSec,
unsigned int fractions = 0)
| encodeDateTimeSec |
[static]
Encode EPOCH time given in seconds to a date/time profile as defined in XEP-0082 and XML Schema Part 2: Datatypes Second Edition
Parameters:
buf | Destination string |
timeSec | The time to encode (in seconds) |
fractions | Optional second fractions |
unsigned int decodeDateTimeSec (const String& time, unsigned int* fractions = 0)
| decodeDateTimeSec |
[static]
Decode a date/time profile as defined in XEP-0082 and XML Schema Part 2: Datatypes Second Edition to EPOCH time
Parameters:
time | The date/time string |
fractions | Pointer to integer to be filled with second fractions, if present |
Returns: The decoded time in seconds, -1 on error
void print (String& xmlStr, XMLElement& element, const char* indent = 0)
|
[static]
Print an XMLElement to a string
Parameters:
xmlStr | The destination string |
element | The element to print |
indent | The indent. 0 if it is the root element |
bool split (NamedList& dest, const char* src, const char sep,
bool nameFirst)
| split |
[static]
Split a string at a delimiter character and fills a named list with its parts Skip empty parts
Parameters:
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 |
int decodeFlags (const String& src, const TokenDict* dict)
| decodeFlags |
[static]
Decode a comma separated list of flags and put them into an integer mask
Parameters:
src | Source string |
dict | Dictionary containing flag names and values |
Returns: The mask of found flags
void buildFlags (String& dest, int src, const TokenDict* dict)
| buildFlags |
[static]
Encode a mask of flags to a comma separated list of names
Parameters:
dest | Destination string |
src | Source mask |
dict | Dictionary containing flag names and values |
bool addChidren (XMLElement* dest, ObjList& list)
| addChidren |
[static]
Add child elements from a list to a destination element
Parameters:
dest | Destination XMLElement |
list | A list containing XML elements |
Returns: True if at least one child was added
inline IqType iqType (const char* text)
| iqType |
[static]
Get the type of an 'iq' stanza as enumeration
Parameters:
text | The text to check |
Returns: Iq type as enumeration
static TokenDict s_iq[] | s_iq[] |
static TokenDict s_commandAction[] | s_commandAction[] |
static TokenDict s_commandStatus[] | s_commandStatus[] |
Generated by: paulc on bussard on Wed Oct 21 01:57:30 2009, using kdoc 2.0a54. |