libzypp 17.31.23
zypp::xml::Node Class Reference

xmlTextReader based interface to Reader's current node. More...

#include <parser/xml/Node.h>

Public Member Functions

 Node ()
 Default ctor.
 
 Node (xmlTextReaderPtr const &reader_r)
 Ctor referencing a Reader.
 
 operator bool () const
 Validate Node in a boolean context.
 
int attributeCount () const
 Provides the number of attributes of the current node.
 
XmlString baseUri () const
 The base URI of the node.
 
int columnNumber () const
 Provide the column number of the current parsing point.
 
int depth () const
 The depth of the node in the tree.
 
XmlString encoding () const
 Determine the encoding of the document being read.
 
XmlString getAttribute (const char *name_r) const
 Provides a copy of the attribute value with the specified qualified name.
 
XmlString getAttribute (const std::string &name_r) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
XmlString getAttributeNo (int no_r) const
 Provides a copy of the attribute value with the specified index relative to the containing element.
 
int hasAttributes () const
 Whether the node has attributes.
 
int hasValue () const
 Whether the node can have a text value.
 
bool isAttribute () const
 Whether this is an Attribute node.
 
int isDefault () const
 Whether an Attribute node was generated from the default value defined in the DTD or schema.
 
int isEmptyElement () const
 Check if the current node is empty.
 
int isNamespaceDecl () const
 Determine whether the current node is a namespace declaration rather than a regular attribute.
 
int lineNumber () const
 Provide the line number of the current parsing point.
 
XmlString localName () const
 The local name of the node.
 
XmlString name () const
 The qualified name of the node, equal to Prefix :LocalName.
 
XmlString namespaceUri () const
 The URI defining the namespace associated with the node.
 
NodeType nodeType () const
 Get the node type of the current node.
 
XmlString prefix () const
 A shorthand reference to the namespace associated with the node.
 
int quoteChar () const
 The quotation mark character used to enclose the value of an attribute.
 
ReadState readState () const
 Gets the read state of the reader.
 
XmlString value () const
 Provides the text value of the node if present.
 
XmlString getValue () const
 Provides a copy of the text value of the node if present.
 
XmlString xmlLang () const
 The xml:lang scope within which the node resides.
 
XmlString xmlVersion () const
 Determine the XML version of the document being read.
 

Private Attributes

xmlTextReaderPtr const & _reader
 Reference to the Reader.
 

Static Private Attributes

static xmlTextReaderPtr const _no_reader = 0
 NULL Reader referenced by default ctor.
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &str, const Node &obj)
 Stream output.
 

Detailed Description

xmlTextReader based interface to Reader's current node.

Node provides xmlTextReader methods that do not change the readers position in the file. Mostly access to the nodes attributes.

Definition at line 35 of file Node.h.

Constructor & Destructor Documentation

◆ Node() [1/2]

zypp::xml::Node::Node ( )

Default ctor.

Definition at line 39 of file Node.cc.

◆ Node() [2/2]

zypp::xml::Node::Node ( xmlTextReaderPtr const &  reader_r)

Ctor referencing a Reader.

Definition at line 48 of file Node.cc.

Member Function Documentation

◆ operator bool()

zypp::xml::Node::operator bool ( ) const
inlineexplicit

Validate Node in a boolean context.

Definition at line 45 of file Node.h.

◆ attributeCount()

int zypp::xml::Node::attributeCount ( ) const
inline

Provides the number of attributes of the current node.

Definition at line 50 of file Node.h.

◆ baseUri()

XmlString zypp::xml::Node::baseUri ( ) const
inline

The base URI of the node.

Definition at line 54 of file Node.h.

◆ columnNumber()

int zypp::xml::Node::columnNumber ( ) const
inline

Provide the column number of the current parsing point.

Definition at line 58 of file Node.h.

◆ depth()

int zypp::xml::Node::depth ( ) const
inline

The depth of the node in the tree.

Definition at line 62 of file Node.h.

◆ encoding()

XmlString zypp::xml::Node::encoding ( ) const
inline

Determine the encoding of the document being read.

Definition at line 66 of file Node.h.

◆ getAttribute() [1/2]

XmlString zypp::xml::Node::getAttribute ( const char *  name_r) const
inline

Provides a copy of the attribute value with the specified qualified name.

Definition at line 71 of file Node.h.

◆ getAttribute() [2/2]

XmlString zypp::xml::Node::getAttribute ( const std::string &  name_r) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 75 of file Node.h.

◆ getAttributeNo()

XmlString zypp::xml::Node::getAttributeNo ( int  no_r) const
inline

Provides a copy of the attribute value with the specified index relative to the containing element.

Definition at line 80 of file Node.h.

◆ hasAttributes()

int zypp::xml::Node::hasAttributes ( ) const
inline

Whether the node has attributes.

Definition at line 84 of file Node.h.

◆ hasValue()

int zypp::xml::Node::hasValue ( ) const
inline

Whether the node can have a text value.

Definition at line 88 of file Node.h.

◆ isAttribute()

bool zypp::xml::Node::isAttribute ( ) const
inline

Whether this is an Attribute node.

Definition at line 92 of file Node.h.

◆ isDefault()

int zypp::xml::Node::isDefault ( ) const
inline

Whether an Attribute node was generated from the default value defined in the DTD or schema.

Definition at line 97 of file Node.h.

◆ isEmptyElement()

int zypp::xml::Node::isEmptyElement ( ) const
inline

Check if the current node is empty.

Definition at line 101 of file Node.h.

◆ isNamespaceDecl()

int zypp::xml::Node::isNamespaceDecl ( ) const
inline

Determine whether the current node is a namespace declaration rather than a regular attribute.

Definition at line 106 of file Node.h.

◆ lineNumber()

int zypp::xml::Node::lineNumber ( ) const
inline

Provide the line number of the current parsing point.

Definition at line 110 of file Node.h.

◆ localName()

XmlString zypp::xml::Node::localName ( ) const
inline

The local name of the node.

Definition at line 114 of file Node.h.

◆ name()

XmlString zypp::xml::Node::name ( ) const
inline

The qualified name of the node, equal to Prefix :LocalName.

Definition at line 118 of file Node.h.

◆ namespaceUri()

XmlString zypp::xml::Node::namespaceUri ( ) const
inline

The URI defining the namespace associated with the node.

Definition at line 122 of file Node.h.

◆ nodeType()

NodeType zypp::xml::Node::nodeType ( ) const
inline

Get the node type of the current node.

Definition at line 126 of file Node.h.

◆ prefix()

XmlString zypp::xml::Node::prefix ( ) const
inline

A shorthand reference to the namespace associated with the node.

Definition at line 130 of file Node.h.

◆ quoteChar()

int zypp::xml::Node::quoteChar ( ) const
inline

The quotation mark character used to enclose the value of an attribute.

Returns
" or ' or -1 in case of error.

Definition at line 135 of file Node.h.

◆ readState()

ReadState zypp::xml::Node::readState ( ) const
inline

Gets the read state of the reader.

Definition at line 139 of file Node.h.

◆ value()

XmlString zypp::xml::Node::value ( ) const
inline

Provides the text value of the node if present.

Definition at line 143 of file Node.h.

◆ getValue()

XmlString zypp::xml::Node::getValue ( ) const
inline

Provides a copy of the text value of the node if present.

Definition at line 147 of file Node.h.

◆ xmlLang()

XmlString zypp::xml::Node::xmlLang ( ) const
inline

The xml:lang scope within which the node resides.

Definition at line 151 of file Node.h.

◆ xmlVersion()

XmlString zypp::xml::Node::xmlVersion ( ) const
inline

Determine the XML version of the document being read.

Definition at line 155 of file Node.h.

Friends And Related Function Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream &  str,
const Node obj 
)
related

Stream output.

Definition at line 57 of file Node.cc.

Member Data Documentation

◆ _no_reader

xmlTextReaderPtr const zypp::xml::Node::_no_reader = 0
staticprivate

NULL Reader referenced by default ctor.

Definition at line 160 of file Node.h.

◆ _reader

xmlTextReaderPtr const& zypp::xml::Node::_reader
private

Reference to the Reader.

Definition at line 162 of file Node.h.


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