InputNode Class Reference

Wrapper around the underlying library for reading DOM elements (nodes). More...

#include <InputNode.h>

Inheritance diagram for InputNode:

Inheritance graph
[legend]
Collaboration diagram for InputNode:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 InputNode ()
 InputNode (QDomElement domElement_h)
 ~InputNode ()
bool setWorkingFile (std::string filename_h)
 Load the file on memory. Return false if no success.
int getIntContent ()
 Get the content between its tagName as integer.
double getDoubleContent ()
 Get the content between its tagName as double.
string getStringContent ()
 Get the content between its tagName as std::string.
bool getBoolContent ()
 Get the content between its tagName as bool.
int getIntAttributeByName (string attributeName_h)
 Get an attribute by name as integer.
double getDoubleAttributeByName (string attributeName_h)
 Get an attribute by name as double.
string getStringAttributeByName (string attributeName_h)
 Get an attribute by name as string.
bool hasAttributeByName (string attributeName_h)
 Check if an attribute with a certain name exist.
InputNode getNodeByName (string nodeName_h, int debugLevel=MSG_CRITICAL_ERROR, bool childFlag=false)
 return 0-or-1 nodes by name.
vector< InputNodegetNodesByName (string nodeName_h, int debugLevel=MSG_WARNING, bool childFlag=false)
vector< InputNodegetChildNodes ()
 Retrieve all child nodes with gived name and optionally with gived attribute or gived pair attribute/value. It raises an error if more than one. Filtered to return only child Elements.
bool hasChildNode (string name_h)
 True if it has specified child node.
int getChildNodesCount ()
 Only Elements.
string getNodeName ()

Private Attributes

QDomElement domElement
 The underlying library-depending DOM rappresentation of the element.

Detailed Description

Wrapper around the underlying library for reading DOM elements (nodes).

A small wrapper class using an underlying library (currently QtXml) to read DOM nodes.
This class works with the individual nodes (DOM Elements), while the companion class InputDocument wrapper the whole document (DOM Document).
Note: In the DOM terminology "Elements" are a subset of the more general "nodes" (that include comments and other typologies..)

Author:
Antonello Lobianco

Definition at line 49 of file InputNode.h.


Constructor & Destructor Documentation

InputNode (  ) 

Definition at line 27 of file InputNode.cpp.

InputNode ( QDomElement  domElement_h  )  [inline]

Definition at line 53 of file InputNode.h.

~InputNode (  ) 

Definition at line 30 of file InputNode.cpp.


Member Function Documentation

bool setWorkingFile ( std::string  filename_h  ) 

Load the file on memory. Return false if no success.

Definition at line 34 of file InputNode.cpp.

Referenced by Gis::initLayers(), and RegData::loadInput().

Here is the caller graph for this function:

int getIntContent (  ) 

Get the content between its tagName as integer.

Definition at line 61 of file InputNode.cpp.

double getDoubleContent (  ) 

Get the content between its tagName as double.

Definition at line 66 of file InputNode.cpp.

std::string getStringContent (  ) 

Get the content between its tagName as std::string.

Definition at line 71 of file InputNode.cpp.

bool getBoolContent (  ) 

Get the content between its tagName as bool.

Definition at line 76 of file InputNode.cpp.

int getIntAttributeByName ( string  attributeName_h  ) 

Get an attribute by name as integer.

Definition at line 87 of file InputNode.cpp.

double getDoubleAttributeByName ( string  attributeName_h  ) 

Get an attribute by name as double.

Definition at line 97 of file InputNode.cpp.

string getStringAttributeByName ( string  attributeName_h  ) 

Get an attribute by name as string.

Definition at line 107 of file InputNode.cpp.

bool hasAttributeByName ( string  attributeName_h  ) 

Check if an attribute with a certain name exist.

Definition at line 117 of file InputNode.cpp.

InputNode getNodeByName ( string  nodeName_h,
int  debugLevel = MSG_CRITICAL_ERROR,
bool  childFlag = false 
)

return 0-or-1 nodes by name.

Definition at line 126 of file InputNode.cpp.

vector< InputNode > getNodesByName ( string  nodeName_h,
int  debugLevel = MSG_WARNING,
bool  childFlag = false 
)

return 0-to-n nodes by name

Definition at line 152 of file InputNode.cpp.

Referenced by getNodeByName(), Gis::initLayers(), and RegData::loadInput().

Here is the caller graph for this function:

vector< InputNode > getChildNodes (  ) 

Retrieve all child nodes with gived name and optionally with gived attribute or gived pair attribute/value. It raises an error if more than one. Filtered to return only child Elements.

Definition at line 232 of file InputNode.cpp.

bool hasChildNode ( string  name_h  ) 

True if it has specified child node.

Definition at line 245 of file InputNode.cpp.

int getChildNodesCount (  ) 

Only Elements.

Definition at line 257 of file InputNode.cpp.

string getNodeName (  ) 

Definition at line 269 of file InputNode.cpp.


Member Data Documentation

QDomElement domElement [private]

The underlying library-depending DOM rappresentation of the element.

Definition at line 78 of file InputNode.h.

Referenced by getBoolContent(), getChildNodes(), getChildNodesCount(), getDoubleAttributeByName(), getDoubleContent(), getIntAttributeByName(), getIntContent(), getNodeName(), getNodesByName(), getStringAttributeByName(), getStringContent(), hasAttributeByName(), hasChildNode(), InputNode(), and setWorkingFile().


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