ChimeraTK-ControlSystemAdapter-OPCUAAdapter
04.00.01
|
This class support any file interaction with a xml file. More...
#include <xml_file_handler.h>
Public Member Functions | |
xml_file_handler (const std::string &filePath) | |
The constructor of the class creates a doc pointer depending on the file path. More... | |
bool | createDoc (const std::string &filePath) |
This methode set a document pointer to the file it ist given by the file path. More... | |
bool | isDocSetted () |
This Methode check if a document is currently setted. More... | |
xmlXPathObjectPtr | getNodeSet (const std::string &xPathString) |
This methode return a pointer of a xPath element depending of the given xPathString. More... | |
~xml_file_handler () | |
Destructor of the class, frees the document and clean the parser. More... | |
Static Public Member Functions | |
static std::vector< xmlNodePtr > | getNodesByName (xmlNodePtr startNode, const std::string &nodeName) |
This methode return a list of all nodes with the given name nodeName starting by the given startNode. More... | |
static std::vector< std::string > | parseVariablePath (const std::string &variablePath, const std::string &seperator="/") |
This methode splitt a given string bey the given seperators. More... | |
static std::string | getAttributeValueFromNode (xmlNode *node, const std::string &attributeName) |
This methode returns a value of the given attribute from the given node you want to know. More... | |
static std::string | getContentFromNode (xmlNode *node) |
This methode returns the value between a xml tag. More... | |
This class support any file interaction with a xml file.
To use all config/mapping xml-files in a confortable way this class provides some useful methodes to read specal nodes, get attributes and so one
Definition at line 44 of file xml_file_handler.h.
ChimeraTK::xml_file_handler::xml_file_handler | ( | const std::string & | filePath | ) |
The constructor of the class creates a doc pointer depending on the file path.
filePath | Path to a xml file which you want to read |
Definition at line 37 of file xml_file_handler.cpp.
ChimeraTK::xml_file_handler::~xml_file_handler | ( | ) |
Destructor of the class, frees the document and clean the parser.
Definition at line 144 of file xml_file_handler.cpp.
bool ChimeraTK::xml_file_handler::createDoc | ( | const std::string & | filePath | ) |
This methode set a document pointer to the file it ist given by the file path.
filePath | Path to a xml file which you want to read |
Definition at line 94 of file xml_file_handler.cpp.
|
static |
This methode returns a value of the given attribute from the given node you want to know.
node | Node with the attribute of interest |
attributeName | Name of the wanted attribute |
Definition at line 122 of file xml_file_handler.cpp.
|
static |
This methode returns the value between a xml tag.
For example <tagelement>content</tagelement> the returned value ist "content".
node | Node with the content of interest |
Definition at line 131 of file xml_file_handler.cpp.
|
static |
This methode return a list of all nodes with the given name nodeName starting by the given startNode.
startNode | Start node, all child nodes will be searched by the given nodeName |
nodeName | Is the name of the xml tag, we use to search for |
Definition at line 44 of file xml_file_handler.cpp.
xmlXPathObjectPtr ChimeraTK::xml_file_handler::getNodeSet | ( | const std::string & | xPathString | ) |
This methode return a pointer of a xPath element depending of the given xPathString.
xPathString | A xPath string we seaching for |
Definition at line 56 of file xml_file_handler.cpp.
bool ChimeraTK::xml_file_handler::isDocSetted | ( | ) |
This Methode check if a document is currently setted.
Definition at line 87 of file xml_file_handler.cpp.
|
static |
This methode splitt a given string bey the given seperators.
You can use the seperator as string of seperators like "_/&" all characters will be used as single seperator
variablePath | String which you want to seperate by the seperator |
seperator | String of, if you want different, seperators, whicht this methode use to split the string |
Definition at line 110 of file xml_file_handler.cpp.