4 * Created on: Apr 17, 2014
8 #ifndef Config_Common_H_
9 #define Config_Common_H_
11 #include "Config_def.h"
17 //>> Forward declaration of xmlNodePtr.
18 typedef struct _xmlNode xmlNode;
19 typedef xmlNode *xmlNodePtr;
23 //>> Forward declaration of xmlDocPtr.
24 typedef struct _xmlDoc xmlDoc;
25 typedef xmlDoc *xmlDocPtr;
30 * Returns true if theNode is XML ELEMENT node (not a "text" node ie).
32 CONFIG_EXPORT bool isElementNode(xmlNodePtr theNode);
35 * Returns true if theNode is XML node with a given name.
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.
42 CONFIG_EXPORT bool isNode(xmlNodePtr theNode, const char* theNodeName, ...);
45 * Every xml node has child. Even if there is no explicit
46 * child nodes libxml gives the "Text node" as child.
48 * This method checks if real child nodes exist in the
51 CONFIG_EXPORT bool hasChild(xmlNodePtr theNode);
56 CONFIG_EXPORT bool getValidatorInfo(xmlNodePtr theNode, std::string& outValidatorId,
57 std::list<std::string>& outValidatorParameters);
60 \brief Convert the given parameter to the platform-specific library name.
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.
67 \param str short library name
68 \return full library name
70 CONFIG_EXPORT std::string library(const std::string& theLibName);