![]() |
ChimeraTK-ControlSystemAdapter-OPCUAAdapter 04.00.05
|
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. | |
| bool | createDoc (const std::string &filePath) |
| This methode set a document pointer to the file it ist given by the file path. | |
| bool | isDocSetted () |
| This Methode check if a document is currently setted. | |
| xmlXPathObjectPtr | getNodeSet (const std::string &xPathString) |
| This methode return a pointer of a xPath element depending of the given xPathString. | |
| ~xml_file_handler () | |
| Destructor of the class, frees the document and clean the parser. | |
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. | |
| static std::vector< std::string > | parseVariablePath (const std::string &variablePath, const std::string &seperator="/") |
| This methode splitt a given string bey the given seperators. | |
| 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. | |
| static std::string | getContentFromNode (xmlNode *node) |
| This methode returns the value between a xml tag. | |
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 38 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 145 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 95 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 123 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 132 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 45 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 57 of file xml_file_handler.cpp.
| bool ChimeraTK::xml_file_handler::isDocSetted | ( | ) |
This Methode check if a document is currently setted.
Definition at line 88 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 111 of file xml_file_handler.cpp.