Salome HOME
Merge branch 'SketchSolver'
[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 <stdarg.h>
15
16 //>> Forward declaration of xmlNodePtr.
17 typedef struct _xmlNode xmlNode;
18 typedef xmlNode *xmlNodePtr;
19 struct _xmlNode;
20 //<<
21
22 //>> Forward declaration of xmlDocPtr.
23 typedef struct _xmlDoc xmlDoc;
24 typedef xmlDoc *xmlDocPtr;
25 struct _xmlDoc;
26 //<<
27
28 /*
29  * Returns true if theNode is XML ELEMENT node (not a "text" node ie).
30  */
31 CONFIG_EXPORT bool isElementNode(xmlNodePtr theNode);
32
33 /*
34  * Returns true if theNode is XML node with a given name.
35
36  * Please note that this function should be called with NULL last argument.
37  * In example: isNode(aNode, "type1", ["type2", ...], NULL);
38  * ", NULL" is required to use unlimited number of arguments.
39  * TODO(sbh): find a way to simplify calling this method.
40  */
41 CONFIG_EXPORT bool isNode(xmlNodePtr theNode, const char* theNodeName, ...);
42
43 /*
44  * Every xml node has child. Even if there is no explicit
45  * child nodes libxml gives the "Text node" as child.
46  *
47  * This method checks if real child nodes exist in the
48  * given node.
49  */
50 CONFIG_EXPORT bool hasChild(xmlNodePtr theNode);
51
52 /*!
53  \brief Convert the given parameter to the platform-specific library name.
54
55  The function appends platform-specific prefix (lib) and suffix (.dll/.so)
56  to the library file name.
57  For example, if \a str = "mylib", "libmylib.so" is returned for Linux and
58  mylib.dll for Windows.
59
60  \param str short library name
61  \return full library name
62  */
63 CONFIG_EXPORT std::string library(const std::string& theLibName);
64
65 #endif