zypp::parser::LibXMLHelper Class Reference

#include <LibXMLHelper.h>

List of all members.

Public Member Functions

 LibXMLHelper ()
 The default constructor will return an object that does not look into the namespace properties of the nodes.
virtual ~LibXMLHelper ()
 Destructor.
std::string attribute (xmlNode *node, const std::string &name, const std::string &defaultValue=std::string()) const
 Fetch an attribute.
std::string content (xmlNode *nodePtr) const
std::string name (const xmlNode *nodePtr) const
 The name of the node.
bool isElement (const xmlNode *nodePtr) const
 returns whether this is an element node (and not, e.g., a attribute or namespace node)
std::string positionInfo (const xmlNode *nodePtr) const
 returns a string that identifies the position of an element nodes e.g.


Detailed Description

Easy access to xmlNodes for C++

Definition at line 29 of file LibXMLHelper.h.


Constructor & Destructor Documentation

zypp::parser::LibXMLHelper::LibXMLHelper (  ) 

The default constructor will return an object that does not look into the namespace properties of the nodes.

Later, another constructor will be added that takes a list of namespaces as parameters (and maybe also character encoding information), and all nodes of different namespaces will be ignored (i.e., attributes will not be used, and for elements in different namespaces isElement() will return false).

Definition at line 24 of file LibXMLHelper.cc.

zypp::parser::LibXMLHelper::~LibXMLHelper (  )  [virtual]

Destructor.

Definition at line 27 of file LibXMLHelper.cc.


Member Function Documentation

std::string zypp::parser::LibXMLHelper::attribute ( xmlNode node,
const std::string &  name,
const std::string &  defaultValue = std::string() 
) const

Fetch an attribute.

Parameters:
node the xmlNode
name name of the attribute
defaultValue the value to return if this attribute does not exist
Returns:
the value of the attribute

Definition at line 30 of file LibXMLHelper.cc.

References xml_assert.

Referenced by zypp::parser::xmlstore::XMLResObjectParser::parseDependencyEntries(), zypp::parser::xmlstore::XMLPatchParser::parseMessageNode(), zypp::parser::xmlstore::XMLResObjectParser::parseResObjectCommonData(), and zypp::parser::xmlstore::XMLProductParser::process().

std::string zypp::parser::LibXMLHelper::content ( xmlNode nodePtr  )  const

The TEXT content of the node and all child nodes Read the value of a node, this can be either the text carried directly by this node if it's a TEXT node or the aggregate string of the values carried by this node child's (TEXT and ENTITY_REF). Entity references are substituted.

Parameters:
nodePtr the xmlNode
Returns:
the content

Definition at line 46 of file LibXMLHelper.cc.

References xml_assert.

Referenced by zypp::parser::xmlstore::XMLResObjectParser::parseDependencyEntries(), zypp::parser::xmlstore::XMLProductParser::parseList(), zypp::parser::xmlstore::XMLPatchParser::parseMessageNode(), zypp::parser::xmlstore::XMLProductParser::parseProductFlags(), zypp::parser::xmlstore::XMLResObjectParser::parseResObjectCommonData(), zypp::parser::xmlstore::XMLPatchParser::parseScriptNode(), zypp::parser::xmlstore::XMLSourceCacheParser::process(), zypp::parser::xmlstore::XMLProductParser::process(), zypp::parser::xmlstore::XMLPatternParser::process(), and zypp::parser::xmlstore::XMLPatchParser::process().

std::string zypp::parser::LibXMLHelper::name ( const xmlNode nodePtr  )  const

The name of the node.

Parameters:
nodePtr the xmlNode
Returns:
the name

Definition at line 59 of file LibXMLHelper.cc.

References xml_assert.

Referenced by zypp::parser::xmlstore::XMLSourceCacheParser::isInterested(), zypp::parser::xmlstore::XMLProductParser::isInterested(), zypp::parser::xmlstore::XMLPatternParser::isInterested(), zypp::parser::xmlstore::XMLPatchParser::isInterested(), zypp::parser::xmlstore::XMLLanguageParser::isInterested(), zypp::parser::xmlstore::XMLPatchParser::parseAtomsNode(), zypp::parser::xmlstore::XMLResObjectParser::parseDependencies(), zypp::parser::xmlstore::XMLResObjectParser::parseDependencyEntries(), zypp::parser::xmlstore::XMLProductParser::parseList(), zypp::parser::xmlstore::XMLPatchParser::parseMessageNode(), zypp::parser::xmlstore::XMLProductParser::parseProductFlags(), zypp::parser::xmlstore::XMLResObjectParser::parseResObjectCommonData(), zypp::parser::xmlstore::XMLPatchParser::parseScriptNode(), zypp::parser::xmlstore::XMLSourceCacheParser::process(), zypp::parser::xmlstore::XMLProductParser::process(), zypp::parser::xmlstore::XMLPatternParser::process(), and zypp::parser::xmlstore::XMLPatchParser::process().

bool zypp::parser::LibXMLHelper::isElement ( const xmlNode nodePtr  )  const

returns whether this is an element node (and not, e.g., a attribute or namespace node)

Parameters:
nodePtr the xmlNode
Returns:
true if it is an element node

Definition at line 66 of file LibXMLHelper.cc.

Referenced by zypp::parser::xmlstore::XMLSourceCacheParser::isInterested(), zypp::parser::xmlstore::XMLProductParser::isInterested(), zypp::parser::xmlstore::XMLPatternParser::isInterested(), zypp::parser::xmlstore::XMLPatchParser::isInterested(), zypp::parser::xmlstore::XMLLanguageParser::isInterested(), zypp::parser::xmlstore::XMLPatchParser::parseAtomsNode(), zypp::parser::xmlstore::XMLResObjectParser::parseDependencies(), zypp::parser::xmlstore::XMLResObjectParser::parseDependencyEntries(), zypp::parser::xmlstore::XMLProductParser::parseList(), zypp::parser::xmlstore::XMLPatchParser::parseMessageNode(), zypp::parser::xmlstore::XMLProductParser::parseProductFlags(), zypp::parser::xmlstore::XMLResObjectParser::parseResObjectCommonData(), zypp::parser::xmlstore::XMLPatchParser::parseScriptNode(), zypp::parser::xmlstore::XMLSourceCacheParser::process(), zypp::parser::xmlstore::XMLProductParser::process(), zypp::parser::xmlstore::XMLPatternParser::process(), and zypp::parser::xmlstore::XMLPatchParser::process().

std::string zypp::parser::LibXMLHelper::positionInfo ( const xmlNode nodePtr  )  const

returns a string that identifies the position of an element nodes e.g.

for error messages

Parameters:
nodePtr the xmlNode
Returns:
the position information

Definition at line 71 of file LibXMLHelper.cc.

Referenced by zypp::parser::xmlstore::XMLResObjectParser::parseDependencyEntries(), and zypp::parser::xmlstore::XMLSourceCacheParser::process().


The documentation for this class was generated from the following files:
Generated on Tue Sep 25 19:23:22 2007 for libzypp by  doxygen 1.5.3