4 * Created on: Apr 17, 2014
8 #ifndef Config_Common_H_
9 #define Config_Common_H_
11 #include "Config_def.h"
16 //>> Forward declaration of xmlNodePtr.
17 typedef struct _xmlNode xmlNode;
18 typedef xmlNode *xmlNodePtr;
22 //>> Forward declaration of xmlDocPtr.
23 typedef struct _xmlDoc xmlDoc;
24 typedef xmlDoc *xmlDocPtr;
29 * Returns true if theNode is XML ELEMENT node (not a "text" node ie).
31 CONFIG_EXPORT bool isElementNode(xmlNodePtr theNode);
34 * Returns true if theNode is XML node with a given name.
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.
41 CONFIG_EXPORT bool isNode(xmlNodePtr theNode, const char* theNodeName, ...);
44 * Every xml node has child. Even if there is no explicit
45 * child nodes libxml gives the "Text node" as child.
47 * This method checks if real child nodes exist in the
50 CONFIG_EXPORT bool hasChild(xmlNodePtr theNode);
53 \brief Convert the given parameter to the platform-specific library name.
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.
60 \param str short library name
61 \return full library name
63 CONFIG_EXPORT std::string library(const std::string& theLibName);