#include <tag.h>
Inherited by Stanza.
Inheritance diagram for Tag:
Public Types | |
typedef std::list< Tag * > | TagList |
Public Member Functions | |
Tag () | |
Tag (const std::string &name, const std::string &cdata="") | |
Tag (Tag *parent, const std::string &name, const std::string &cdata="") | |
virtual | ~Tag () |
virtual const std::string | xml () const |
virtual void | addAttribute (const std::string &name, const std::string &value) |
virtual void | addAttribute (const std::string &name, int value) |
virtual void | addChild (Tag *child) |
virtual void | setCData (const std::string &cdata) |
virtual void | addCData (const std::string &cdata) |
virtual const std::string & | name () const |
virtual const std::string | cdata () const |
virtual StringMap & | attributes () |
virtual TagList & | children () |
virtual const std::string | findAttribute (const std::string &name) const |
virtual bool | hasAttribute (const std::string &name, const std::string &value="") const |
virtual Tag * | findChild (const std::string &name) |
virtual Tag * | findChild (const std::string &name, const std::string &attr, const std::string &value="") |
virtual bool | hasChild (const std::string &name, const std::string &attr="", const std::string &value="") const |
virtual Tag * | findChildWithAttrib (const std::string &attr, const std::string &value="") |
virtual bool | hasChildWithAttrib (const std::string &attr, const std::string &value="") const |
virtual bool | empty () const |
bool | hasChildWithCData (const std::string &name, const std::string &cdata) const |
Tag * | parent () |
virtual StanzaType | type () const |
virtual Tag * | clone () const |
Protected Attributes | |
std::string | m_name |
StringMap | m_attribs |
std::string | m_cdata |
TagList | m_children |
Tag * | m_parent |
StanzaType | m_type |
Definition at line 32 of file tag.h.
Tag | ( | ) |
Creates an empty tag.
Definition at line 20 of file tag.cpp.
Referenced by Tag::clone(), Stanza::createIqStanza(), Stanza::createMessageStanza(), Stanza::createPresenceStanza(), and Stanza::createSubscriptionStanza().
Tag | ( | const std::string & | name, | |
const std::string & | cdata = "" | |||
) |
void addAttribute | ( | const std::string & | name, | |
int | value | |||
) | [virtual] |
void addAttribute | ( | const std::string & | name, | |
const std::string & | value | |||
) | [virtual] |
Use this function to add a new attribute to the tag.
name | The name of the attribute. | |
value | The value of the attribute. |
Definition at line 88 of file tag.cpp.
Referenced by RosterManager::ackSubscriptionRequest(), RosterManager::add(), Client::bindResource(), Registration::changePassword(), Registration::createAccount(), Stanza::createIqStanza(), Stanza::createMessageStanza(), Stanza::createPresenceStanza(), Stanza::createSubscriptionStanza(), MessageEventFilter::decorate(), ChatStateFilter::decorate(), NonSaslAuth::doAuth(), FlexibleOffline::fetchMessages(), Registration::fetchRegistrationFields(), VCardManager::fetchVCard(), RosterManager::fill(), Disco::getDiscoInfo(), Disco::getDiscoItems(), RosterManager::handleIq(), PrivacyManager::handleIq(), LastActivity::handleIq(), InBandBytestreamManager::handleIq(), Disco::handleIq(), NonSaslAuth::handleIqID(), RosterManager::handleSubscription(), ClientBase::processSASLChallenge(), LastActivity::query(), MessageEventFilter::raiseMessageEvent(), Registration::removeAccount(), PrivacyManager::removeList(), FlexibleOffline::removeMessages(), InBandBytestreamManager::requestInBandBytestream(), PrivacyManager::requestList(), PrivacyManager::requestListNames(), PrivateXML::requestXML(), MessageSession::send(), InBandBytestream::sendBlock(), PrivacyManager::setActive(), ChatStateFilter::setChatState(), PrivacyManager::setDefault(), RosterManager::setDelimiter(), ClientBase::startSASL(), ClientBase::startTls(), PrivacyManager::store(), Annotations::storeAnnotations(), BookmarkStorage::storeBookmarks(), VCardManager::storeVCard(), PrivateXML::storeXML(), RosterManager::subscribe(), RosterManager::synchronize(), VCard::tag(), DataFormField::tag(), DataForm::tag(), gloox::tagHook(), PrivacyManager::unsetActive(), PrivacyManager::unsetDefault(), and RosterManager::unsubscribe().
void addCData | ( | const std::string & | cdata | ) | [virtual] |
Adds the string to the existing XML character data for this Tag.
cdata | The additional cdata. |
Definition at line 52 of file tag.cpp.
Referenced by gloox::cdataHook().
void addChild | ( | Tag * | child | ) | [virtual] |
Use this function to add a child node to the tag.
child | The node to be inserted. |
Definition at line 104 of file tag.cpp.
Referenced by Tag::clone(), Stanza::Stanza(), VCardManager::storeVCard(), PrivateXML::storeXML(), Tag::Tag(), and gloox::tagHook().
StringMap & attributes | ( | ) | [virtual] |
Use this function to manipulate the list of attributes.
Definition at line 118 of file tag.cpp.
Referenced by Stanza::Stanza().
const std::string cdata | ( | ) | const [virtual] |
Use this function to retrieve the XML character data of an element.
Definition at line 113 of file tag.cpp.
Referenced by Tag::clone(), InBandBytestream::filter(), Registration::handleIqID(), RosterManager::handlePrivateXML(), and Stanza::init().
Tag::TagList & children | ( | ) | [virtual] |
Use this function to manipulate the list of child elements.
Definition at line 123 of file tag.cpp.
Referenced by DataForm::DataForm(), DataFormField::DataFormField(), FlexibleOffline::handleDiscoItemsResult(), PrivateXML::handleIqID(), PrivacyManager::handleIqID(), BookmarkStorage::handlePrivateXML(), Annotations::handlePrivateXML(), Stanza::init(), Stanza::Stanza(), and VCard::VCard().
Tag * clone | ( | ) | const [virtual] |
This function creates a deep copy of this Tag.
Definition at line 270 of file tag.cpp.
Referenced by Registration::createAccount().
virtual bool empty | ( | ) | const [inline, virtual] |
const std::string findAttribute | ( | const std::string & | name | ) | const [virtual] |
This function can be used to retrieve the value of a Tag's attribute.
name | The name of the attribute to look for. |
Definition at line 128 of file tag.cpp.
Referenced by DataFormField::DataFormField(), InBandBytestream::filter(), PrivacyManager::handleIq(), InBandBytestreamManager::handleIq(), Disco::handleIq(), Adhoc::handleIq(), PrivacyManager::handleIqID(), LastActivity::handleIqID(), and Stanza::init().
Tag * findChild | ( | const std::string & | name, | |
const std::string & | attr, | |||
const std::string & | value = "" | |||
) | [virtual] |
This function finds and returns the first element within the child elements of the current tag, that has a certan name, and a certain attribute with a certain value.
name | The name of the element to search for. | |
attr | The name of the attribute of the child element. | |
value | The value of the attribute of the child element. |
Tag * findChild | ( | const std::string & | name | ) | [virtual] |
This function finds and returns the first element within the child elements of the current tag that has a matching tag name.
name | The name of the element to search for. |
Definition at line 149 of file tag.cpp.
Referenced by MessageEventFilter::filter(), InBandBytestream::filter(), FlexibleOffline::handleDiscoInfoResult(), FlexibleOffline::handleDiscoItemsResult(), Registration::handleIq(), PrivacyManager::handleIq(), InBandBytestreamManager::handleIq(), Disco::handleIq(), Adhoc::handleIq(), VCardManager::handleIqID(), Registration::handleIqID(), PrivateXML::handleIqID(), PrivacyManager::handleIqID(), NonSaslAuth::handleIqID(), LastActivity::handleIqID(), and Stanza::init().
Tag * findChildWithAttrib | ( | const std::string & | attr, | |
const std::string & | value = "" | |||
) | [virtual] |
This function checks whether the Tag has a child element which posesses a given attribute with an optional value. The name of the child element does not matter.
attr | The name of the attribute of the child element. | |
value | The value of the attribute of the child element. |
Definition at line 217 of file tag.cpp.
Referenced by Stanza::init().
bool hasAttribute | ( | const std::string & | name, | |
const std::string & | value = "" | |||
) | const [virtual] |
Checks whether the tag has a attribute with given name and optional value.
name | The name of the attribute to check for. | |
value | The value of the attribute to check for. |
Definition at line 137 of file tag.cpp.
Referenced by DataForm::DataForm(), DataFormField::DataFormField(), FlexibleOffline::handleDiscoItemsResult(), PrivacyManager::handleIq(), InBandBytestreamManager::handleIq(), NonSaslAuth::handleIqID(), and Stanza::init().
bool hasChild | ( | const std::string & | name, | |
const std::string & | attr = "" , |
|||
const std::string & | value = "" | |||
) | const [virtual] |
This function checks whether the Tag has a child element with a given name, and optionally this child element is checked for having a given attribute with an optional value.
name | The name of the child element. | |
attr | The name of the attribute of the child element. | |
value | The value of the attribute of the child element. |
Definition at line 174 of file tag.cpp.
Referenced by MessageEventFilter::filter(), ChatStateFilter::filter(), FlexibleOffline::handleDiscoInfoResult(), Adhoc::handleIq(), Registration::handleIqID(), PrivacyManager::handleIqID(), NonSaslAuth::handleIqID(), Stanza::init(), and ClientBase::processSASLError().
bool hasChildWithAttrib | ( | const std::string & | attr, | |
const std::string & | value = "" | |||
) | const [virtual] |
This function checks whether the Tag has a child element which posesses a given attribute with an optional value. The name of the child element does not matter.
attr | The name of the attribute of the child element. | |
value | The value of the attribute of the child element. |
bool hasChildWithCData | ( | const std::string & | name, | |
const std::string & | cdata | |||
) | const |
This function checks whether a child element with given name exists and has XML character data that equals the given cdata string.
name | The name of the child element. | |
cdata | The character data that has to exist in the child element. |
Definition at line 191 of file tag.cpp.
Referenced by Stanza::init().
virtual const std::string& name | ( | ) | const [inline, virtual] |
Use this function to retrieve the name of an element.
Definition at line 110 of file tag.h.
Referenced by Tag::clone(), DataForm::DataForm(), Component::handleNormalNode(), and gloox::tagHook().
Tag* parent | ( | ) | [inline] |
void setCData | ( | const std::string & | cdata | ) | [virtual] |
Sets the XML character data for this Tag.
cdata | The new cdata. |
Definition at line 47 of file tag.cpp.
Referenced by ClientBase::startSASL().
virtual StanzaType type | ( | ) | const [inline, virtual] |
Returns the stanza type.
Definition at line 218 of file tag.h.
Referenced by ClientBase::send().
const std::string xml | ( | ) | const [virtual] |
This function can be used to retrieve the complete XML of a tag as a string. It includes all the attributes, child nodes and character data.
Definition at line 57 of file tag.cpp.
Referenced by ClientBase::send().