#include <jabberoo.hh>
Inheritance diagram for jabberoo::Packet::

Public Methods | |
| Packet (const string &name) | |
| Jabber Packet constructor with a base element of name. More... | |
| Packet (const Element &t) | |
| Jabber Packet constructor based upon a judo::Element Create a Jabber Packet based off of a judo::Element. More... | |
| const string | getFrom () const |
| from attribute on the base element. More... | |
| const string | getTo () const |
| to attribute on the base element. More... | |
| const string | getID () const |
| id attribute on the base element. More... | |
| const string | getError () const |
| error subelement of the base element. More... | |
| const int | getErrorCode () const |
| code attribute on the error subelement. More... | |
| const string | toString () const |
| XML string form of the Jabber Packet. More... | |
| const Element& | getBaseElement () const |
| XML judo::Element form of the Jabber Packet. More... | |
| void | setFrom (const string &from) |
| from attribute on the base element. More... | |
| void | setTo (const string &to) |
| to attribute on the base element. More... | |
| void | setID (const string &id) |
| id attribute on the base element. More... | |
| Element* | addX () |
| Add x element to the packet. More... | |
| Element* | addX (const string &tnamespace) |
| Add x element to the packet. More... | |
| Element* | findX (const string &tnamespace) const |
| Get the x (extension) element which has an xmlns of tnamespace. More... | |
| Element& | getBaseElement () |
| Access to the base element. More... | |
Protected Attributes | |
| Element | _base |
This class has accessors and modifiers for several common Jabber attributes and elements.
Definition at line 96 of file jabberoo.hh.
|
|
Jabber Packet constructor with a base element of name. Create a Jabber Packet with a base element of name.
Definition at line 34 of file jabberoo-packet.cc. 00035 : _base(name)
00036 {}
|
|
|
Jabber Packet constructor based upon a judo::Element Create a Jabber Packet based off of a judo::Element.
Definition at line 38 of file jabberoo-packet.cc. 00039 : _base(t)
00040 {}
|
|
|
Add x element to the packet. Adds an x (extension) element to the Jabber Packet with the given namespace.
Definition at line 101 of file jabberoo-packet.cc. 00102 {
00103 Element* x = _base.addElement("x");
00104 x->putAttrib("xmlns", tnamespace);
00105 return x;
00106 }
|
|
|
Add x element to the packet. Adds an x (extension) element to the Jabber Packet. x elements should have an xmlns attribute.
Definition at line 96 of file jabberoo-packet.cc. Referenced by jabberoo::Message::Message(), jabberoo::Message::requestComposing(), jabberoo::Message::requestDelivered(), and jabberoo::Message::requestDisplayed().
00097 {
00098 return _base.addElement("x");
00099 }
|
|
|
Get the x (extension) element which has an xmlns of tnamespace.
Definition at line 108 of file jabberoo-packet.cc. Referenced by jabberoo::Message::Message(), jabberoo::Message::requestComposing(), jabberoo::Message::requestDelivered(), and jabberoo::Message::requestDisplayed().
00109 {
00110 Element::const_iterator it = _base.begin();
00111 for (; it != _base.end(); it++)
00112 {
00113 if (((*it)->getType() == Node::ntElement) &&
00114 ((static_cast<Element*>(*it))->cmpAttrib("xmlns", tnamespace)))
00115 break;
00116 }
00117 if (it != _base.end())
00118 return static_cast<Element*>(*it);
00119 else
00120 return NULL;
00121 }
|
|
|
Access to the base element.
Definition at line 123 of file jabberoo-packet.cc. 00124 {
00125 return _base;
00126 }
|
|
|
XML judo::Element form of the Jabber Packet.
Definition at line 76 of file jabberoo-packet.cc. 00077 {
00078 return _base;
00079 }
|
|
|
error subelement of the base element.
Definition at line 57 of file jabberoo-packet.cc. 00058 {
00059 return string(_base.getChildCData("error"));
00060 }
|
|
|
code attribute on the error subelement.
Definition at line 62 of file jabberoo-packet.cc. 00063 {
00064 const Element* error = _base.findElement("error");
00065 if (error)
00066 return atoi(error->getAttrib("code").c_str());
00067 else
00068 return 0;
00069 }
|
|
|
from attribute on the base element.
Definition at line 42 of file jabberoo-packet.cc. Referenced by jabberoo::Message::Message(), jabberoo::Message::composing(), jabberoo::Message::delivered(), and jabberoo::Message::displayed().
00043 {
00044 return _base.getAttrib("from");
00045 }
|
|
|
id attribute on the base element.
Definition at line 52 of file jabberoo-packet.cc. Referenced by jabberoo::Message::composing(), jabberoo::Message::delivered(), and jabberoo::Message::displayed().
00053 {
00054 return _base.getAttrib("id");
00055 }
|
|
|
to attribute on the base element.
Definition at line 47 of file jabberoo-packet.cc. 00048 {
00049 return _base.getAttrib("to");
00050 }
|
|
|
from attribute on the base element.
Definition at line 81 of file jabberoo-packet.cc. 00082 {
00083 _base.putAttrib("from", from);
00084 }
|
|
|
id attribute on the base element.
Definition at line 91 of file jabberoo-packet.cc. 00092 {
00093 _base.putAttrib("id", id);
00094 }
|
|
|
to attribute on the base element.
Definition at line 86 of file jabberoo-packet.cc. Referenced by jabberoo::Message::Message(), and jabberoo::Presence::Presence().
00087 {
00088 _base.putAttrib("to", to);
00089 }
|
|
|
XML string form of the Jabber Packet.
Definition at line 71 of file jabberoo-packet.cc. 00072 {
00073 return _base.toString();
00074 }
|
1.2.8.1 written by Dimitri van Heesch,
© 1997-2001