Ginga  0.13.6.2086-83aa
The iTV middleware.
ParserElt Class Reference

Parser element wrapper. More...

Collaboration diagram for ParserElt:

Public Member Functions

 ParserElt (xmlNode *)
 Creates a new element. More...
 
 ~ParserElt ()
 Destroys element.
 
string getTag ()
 Gets element tag. More...
 
xmlNode * getNode ()
 Gets element node. More...
 
xmlNode * getParentNode ()
 Gets element parent node. More...
 
const map< string, string > * getAttributes ()
 Gets element attribute map. More...
 
bool getAttribute (const string &, string *)
 Gets element attribute value. More...
 
bool setAttribute (const string &, const string &)
 Sets element attribute value. More...
 
bool getData (const string &, void **)
 Gets user data attached to element. More...
 
bool setData (const string &, void *, UserDataCleanFunc fn=nullptr)
 Attaches user data to element. More...
 

Private Attributes

string _tag
 Element tag.
 
xmlNode * _node
 Corresponding node in document tree.
 
map< string, string > _attrs
 Element attributes.
 
UserData _udata
 Attached user data.
 

Detailed Description

Parser element wrapper.

Data associated with a specific xmlNode.

Constructor & Destructor Documentation

◆ ParserElt()

ParserElt::ParserElt ( xmlNode *  node)

Creates a new element.

Parameters
nodeThe node to wrap.
Returns
New ParserElt.

Member Function Documentation

◆ getAttribute()

bool ParserElt::getAttribute ( const string &  name,
string *  value 
)

Gets element attribute value.

Parameters
nameAttribute name.
[out]valueVariable to store the attribute value (if any).
Returns
true if successful, or false otherwise.

◆ getAttributes()

const map< string, string > * ParserElt::getAttributes ( )

Gets element attribute map.

Returns
Attribute map.

◆ getData()

bool ParserElt::getData ( const string &  key,
void **  value 
)

Gets user data attached to element.

Parameters
keyUser data key.
[out]valueVariable to store the user data value (if any).
Returns
true if successful, or false otherwise.

◆ getNode()

xmlNode * ParserElt::getNode ( )

Gets element node.

Returns
Associated node.

◆ getParentNode()

xmlNode * ParserElt::getParentNode ( )

Gets element parent node.

Returns
Parent of associated node.

◆ getTag()

string ParserElt::getTag ( )

Gets element tag.

Returns
Tag.

◆ setAttribute()

bool ParserElt::setAttribute ( const string &  name,
const string &  value 
)

Sets element attribute value.

Parameters
nameAttribute name.
valueAttribute value.
Returns
true if the attribute was previously unset, or false otherwise.

◆ setData()

bool ParserElt::setData ( const string &  key,
void *  value,
UserDataCleanFunc  fn = nullptr 
)

Attaches user data to element.

Parameters
keyUser data key.
valueUser data value.
fnCleanup function (used to destroy data when ParserElt is destroyed or key is overwritten).
Returns
true if key was previously unset, or false otherwise.

The documentation for this class was generated from the following file: