Salome HOME
Example "PythonFeatures" plugin removed
[modules/shaper.git] / src / Config / Config_Common.cpp
index b3a93acd1963a5fd52eaf6a78e9294803172cd55..e0837036eb71d200a1a40581e3a98ad3854dfcba 100644 (file)
@@ -1,3 +1,5 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D\r
+\r
 /*\r
  * Config_Common.cpp\r
  *\r
@@ -14,7 +16,8 @@
 #include <sstream> // for stringstream\r
 \r
 #include <string>\r
-#include <algorithm> // for std::transform\r\r
+#include <algorithm> // for std::transform\r
+\r
 bool isElementNode(xmlNodePtr theNode)\r
 {\r
   return theNode->type == XML_ELEMENT_NODE;\r
@@ -55,7 +58,7 @@ bool isWidgetNode(xmlNodePtr theNode)
     return false;\r
 \r
   //it should not be a "source" or a "validator" node\r
-  return !isNode(theNode, NODE_SOURCE, NODE_VALIDATOR, NULL);\r
+  return !isNode(theNode, NODE_SOURCE, NODE_VALIDATOR, NODE_SELFILTER, NULL);\r
 }\r
 \r
 bool hasChild(xmlNodePtr theNode)\r
@@ -69,25 +72,25 @@ bool hasChild(xmlNodePtr theNode)
   return false;\r
 }\r
 \r
-bool getValidatorInfo(xmlNodePtr theNode, std::string& outValidatorId,\r
+bool getParametersInfo(xmlNodePtr theNode, std::string& outPropertyId,\r
                       std::list<std::string>& outValidatorParameters)\r
 {\r
-  //Validator id:\r
+  //Property id:\r
   char* anIdProp = (char*) xmlGetProp(theNode, BAD_CAST _ID);\r
   if (!anIdProp || anIdProp[0] == 0) {\r
     return false;\r
   }\r
-  outValidatorId = std::string(anIdProp);\r
+  outPropertyId = std::string(anIdProp);\r
 \r
-  //Validator parameters:\r
-  char* aParamProp = (char*) xmlGetProp(theNode, BAD_CAST VALIDATOR_PARAMETERS);\r
+  //Property parameters:\r
+  char* aParamProp = (char*) xmlGetProp(theNode, BAD_CAST _PARAMETERS);\r
   if (aParamProp && aParamProp[0] != 0) {\r
     std::string aPropString = std::string(aParamProp);\r
     std::stringstream aPropStringStream(aPropString);\r
     char COMMA_DELIM = ',';\r
-    std::string aValidatorParameter;\r
-    while (std::getline(aPropStringStream, aValidatorParameter, ',')) {\r
-      outValidatorParameters.push_back(aValidatorParameter);\r
+    std::string aParameter;\r
+    while (std::getline(aPropStringStream, aParameter, ',')) {\r
+      outValidatorParameters.push_back(aParameter);\r
     }\r
   }\r
   return true;\r
@@ -95,6 +98,8 @@ bool getValidatorInfo(xmlNodePtr theNode, std::string& outValidatorId,
 \r
 std::string library(const std::string& theLibName)\r
 {\r
+  if(theLibName.empty())\r
+    return std::string();\r
   std::string aLibName = theLibName;\r
 #ifndef WIN32\r
   static std::string aLibExt( ".so" );\r