X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FConfig%2FConfig_Common.cpp;h=e0837036eb71d200a1a40581e3a98ad3854dfcba;hb=031fb5e7c551e695afa72a9de299f118a40d8d88;hp=b3a93acd1963a5fd52eaf6a78e9294803172cd55;hpb=acebef0bc5fb22dc9672e0046085b896e957af56;p=modules%2Fshaper.git diff --git a/src/Config/Config_Common.cpp b/src/Config/Config_Common.cpp index b3a93acd1..e0837036e 100644 --- a/src/Config/Config_Common.cpp +++ b/src/Config/Config_Common.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + /* * Config_Common.cpp * @@ -14,7 +16,8 @@ #include // for stringstream #include -#include // for std::transform +#include // for std::transform + bool isElementNode(xmlNodePtr theNode) { return theNode->type == XML_ELEMENT_NODE; @@ -55,7 +58,7 @@ bool isWidgetNode(xmlNodePtr theNode) return false; //it should not be a "source" or a "validator" node - return !isNode(theNode, NODE_SOURCE, NODE_VALIDATOR, NULL); + return !isNode(theNode, NODE_SOURCE, NODE_VALIDATOR, NODE_SELFILTER, NULL); } bool hasChild(xmlNodePtr theNode) @@ -69,25 +72,25 @@ bool hasChild(xmlNodePtr theNode) return false; } -bool getValidatorInfo(xmlNodePtr theNode, std::string& outValidatorId, +bool getParametersInfo(xmlNodePtr theNode, std::string& outPropertyId, std::list& outValidatorParameters) { - //Validator id: + //Property id: char* anIdProp = (char*) xmlGetProp(theNode, BAD_CAST _ID); if (!anIdProp || anIdProp[0] == 0) { return false; } - outValidatorId = std::string(anIdProp); + outPropertyId = std::string(anIdProp); - //Validator parameters: - char* aParamProp = (char*) xmlGetProp(theNode, BAD_CAST VALIDATOR_PARAMETERS); + //Property parameters: + char* aParamProp = (char*) xmlGetProp(theNode, BAD_CAST _PARAMETERS); if (aParamProp && aParamProp[0] != 0) { std::string aPropString = std::string(aParamProp); std::stringstream aPropStringStream(aPropString); char COMMA_DELIM = ','; - std::string aValidatorParameter; - while (std::getline(aPropStringStream, aValidatorParameter, ',')) { - outValidatorParameters.push_back(aValidatorParameter); + std::string aParameter; + while (std::getline(aPropStringStream, aParameter, ',')) { + outValidatorParameters.push_back(aParameter); } } return true; @@ -95,6 +98,8 @@ bool getValidatorInfo(xmlNodePtr theNode, std::string& outValidatorId, std::string library(const std::string& theLibName) { + if(theLibName.empty()) + return std::string(); std::string aLibName = theLibName; #ifndef WIN32 static std::string aLibExt( ".so" );