Salome HOME
Sources formated according to the codeing standards
[modules/shaper.git] / src / Config / Config_Common.h
1 /*
2  * Config_Common.h
3  *
4  *  Created on: Apr 17, 2014
5  *      Author: sbh
6  */
7
8 #ifndef Config_Common_H_
9 #define Config_Common_H_
10
11 #include "Config_def.h"
12
13 #include <string>
14 #include <list>
15 #include <stdarg.h>
16
17 //>> Forward declaration of xmlNodePtr.
18 typedef struct _xmlNode xmlNode;
19 typedef xmlNode *xmlNodePtr;
20 struct _xmlNode;
21 //<<
22
23 //>> Forward declaration of xmlDocPtr.
24 typedef struct _xmlDoc xmlDoc;
25 typedef xmlDoc *xmlDocPtr;
26 struct _xmlDoc;
27 //<<
28
29 /*
30  * Returns true if theNode is XML ELEMENT node (not a "text" node ie).
31  */
32 CONFIG_EXPORT bool isElementNode(xmlNodePtr theNode);
33
34 /*
35  * Returns true if theNode is XML node with a given name.
36
37  * Please note that this function should be called with NULL last argument.
38  * In example: isNode(aNode, "type1", ["type2", ...], NULL);
39  * ", NULL" is required to use unlimited number of arguments.
40  * TODO(sbh): find a way to simplify calling this method.
41  */
42 CONFIG_EXPORT bool isNode(xmlNodePtr theNode, const char* theNodeName, ...);
43
44 /*
45  * Every xml node has child. Even if there is no explicit
46  * child nodes libxml gives the "Text node" as child.
47  *
48  * This method checks if real child nodes exist in the
49  * given node.
50  */
51 CONFIG_EXPORT bool hasChild(xmlNodePtr theNode);
52
53 /*
54  *
55  */
56 CONFIG_EXPORT bool getValidatorInfo(xmlNodePtr theNode, std::string& outValidatorId,
57                                     std::list<std::string>& outValidatorParameters);
58
59 /*!
60  \brief Convert the given parameter to the platform-specific library name.
61
62  The function appends platform-specific prefix (lib) and suffix (.dll/.so)
63  to the library file name.
64  For example, if \a str = "mylib", "libmylib.so" is returned for Linux and
65  mylib.dll for Windows.
66
67  \param str short library name
68  \return full library name
69  */
70 CONFIG_EXPORT std::string library(const std::string& theLibName);
71
72 #endif