ginga 1.0
The Ginga iTV middleware
Loading...
Searching...
No Matches
ginga::ParserElt Class Reference

Parser element wrapper. More...

Collaboration diagram for ginga::ParserElt:

Public Member Functions

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

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()

ginga::ParserElt::ParserElt ( xmlNode * node)
explicit

Creates a new element.

Parameters
nodeThe node to wrap.
Returns
New ParserElt.

Member Function Documentation

◆ getAttribute()

bool ginga::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 > * ginga::ParserElt::getAttributes ( )

Gets element attribute map.

Returns
Attribute map.

◆ getData()

bool ginga::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 * ginga::ParserElt::getNode ( )

Gets element node.

Returns
Associated node.

◆ getParentNode()

xmlNode * ginga::ParserElt::getParentNode ( )

Gets element parent node.

Returns
Parent of associated node.

◆ getTag()

string ginga::ParserElt::getTag ( )

Gets element tag.

Returns
Tag.

◆ setAttribute()

bool ginga::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 ginga::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: