Salome HOME
The obligatory and concealment attribute's properties now registers in model by speci...
[modules/shaper.git] / src / Config / Config_Common.h
index 40051dc2ac209f5d0389d4fe5f712cc5eb8017de..0c2689757cc3958a3cc3e6a7b605931f34a86320 100644 (file)
@@ -5,12 +5,13 @@
  *      Author: sbh
  */
 
-#ifndef Config_Common_H_
-#define Config_Common_H_
+#ifndef CONFIG_COMMON_H_
+#define CONFIG_COMMON_H_
 
-#include "Config.h"
+#include "Config_def.h"
 
 #include <string>
+#include <list>
 #include <stdarg.h>
 
 //>> Forward declaration of xmlNodePtr.
@@ -40,6 +41,11 @@ CONFIG_EXPORT bool isElementNode(xmlNodePtr theNode);
  */
 CONFIG_EXPORT bool isNode(xmlNodePtr theNode, const char* theNodeName, ...);
 
+/*
+ * Checks is the given node is attribute (widget) node.
+ */
+CONFIG_EXPORT bool isWidgetNode(xmlNodePtr theNode);
+
 /*
  * Every xml node has child. Even if there is no explicit
  * child nodes libxml gives the "Text node" as child.
@@ -49,6 +55,12 @@ CONFIG_EXPORT bool isNode(xmlNodePtr theNode, const char* theNodeName, ...);
  */
 CONFIG_EXPORT bool hasChild(xmlNodePtr theNode);
 
+/*
+ *
+ */
+CONFIG_EXPORT bool getValidatorInfo(xmlNodePtr theNode, std::string& outValidatorId,
+                                    std::list<std::string>& outValidatorParameters);
+
 /*!
  \brief Convert the given parameter to the platform-specific library name.
 
@@ -62,4 +74,21 @@ CONFIG_EXPORT bool hasChild(xmlNodePtr theNode);
  */
 CONFIG_EXPORT std::string library(const std::string& theLibName);
 
+/*
+ * Returns named property for a given node as std::string.
+ */
+CONFIG_EXPORT std::string getProperty(xmlNodePtr theNode, const char* thePropName);
+
+/*
+ * Checks if the given XML node has the given attribute,
+ * if yes - returns it's bool value, if no, or if the value can not
+ * be converted to bool - returns theDefault value.
+ * \param theAttributeName attribute to check
+ * \param theDefault default value on bad data
+ * \return the boolean result
+ */
+CONFIG_EXPORT bool getBooleanAttribute(xmlNodePtr theNode,
+                                       const char* theAttributeName,
+                                       bool theDefault);
+
 #endif