From d63acd4681fce1fc2aff15c3320179eb156f8d13 Mon Sep 17 00:00:00 2001 From: jfa Date: Mon, 22 Oct 2007 08:57:18 +0000 Subject: [PATCH] Debug new parser. --- .../SALOME_ModuleCatalog_Handler.cxx | 880 +++++++++--------- .../SALOME_ModuleCatalog_impl.cxx | 2 +- 2 files changed, 441 insertions(+), 441 deletions(-) diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_Handler.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_Handler.cxx index be66d8ee0..c4104d9bd 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_Handler.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_Handler.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -144,445 +144,445 @@ void SALOME_ModuleCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc) // Processing the document nodes while(aCurNode != NULL) + { + // Process path prefix list (tag test_path_prefix_list) + if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_path_prefix_list) ) { - // Process path prefix list (tag test_path_prefix_list) - if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_path_prefix_list) ) - { - xmlNodePtr aCurSubNode = aCurNode->xmlChildrenNode; - while(aCurSubNode != NULL) - { - // Forming a PathPrefix structure (tag test_path_prefix) - if ( xmlStrcmp(aCurSubNode->name, (const xmlChar*)test_path_prefix) ) { - aCurSubNode = aCurSubNode->next; - continue; - } - - xmlNodePtr aCurSubSubNode = aCurSubNode->xmlChildrenNode; - while(aCurSubSubNode != NULL) - { - // Tag test_path_prefix_name - if ( !xmlStrcmp(aCurSubSubNode->name, (const xmlChar*)test_path_prefix_name) ) { - xmlChar* aPath = xmlNodeGetContent(aCurSubSubNode); - if (aPath != NULL) { - _pathPrefix.path = (const char*)aPath; - xmlFree(aPath); - } - } - - // Tag test_computer_list - if ( !xmlStrcmp(aCurSubSubNode->name, (const xmlChar*)test_computer_list) ) { - xmlNodePtr aComputerNode = aCurSubSubNode->xmlChildrenNode; - while (aComputerNode != NULL) { - // Tag test_computer_name - if ( !xmlStrcmp(aComputerNode->name, (const xmlChar*) test_computer_name) ) { - xmlChar* aCompName = xmlNodeGetContent(aComputerNode); - if (aCompName != NULL) { - _pathPrefix.listOfComputer.push_back((const char*)aCompName); - xmlFree(aCompName); - } - } - - aComputerNode = aComputerNode->next; - } - } - - aCurSubSubNode = aCurSubSubNode->next; - } - - _pathList.push_back(_pathPrefix); - _pathPrefix.listOfComputer.resize(0); - - aCurSubNode = aCurSubNode->next; - } - } - - //@ Process list of components (tag test_component_list) - if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_component_list) ) - { - xmlNodePtr aComponentNode = aCurNode->xmlChildrenNode; - while(aComponentNode != NULL) - { - // Do not process tags differ from test_component here - if ( xmlStrcmp(aComponentNode->name, (const xmlChar*)test_component) ) { - aComponentNode = aComponentNode->next; - continue; - } - - // Component identification - - // Empty temporary structures - _aModule.name = ""; - _aModule.constraint = ""; - _aModule.icon=""; - _aModule.interfaces.resize(0); - - xmlNodePtr aComponentSubNode = aComponentNode->xmlChildrenNode; - while(aComponentSubNode != NULL) { - - xmlChar* aNodeContent = xmlNodeGetContent(aComponentSubNode); - - if (aNodeContent == NULL) { - aComponentSubNode = aComponentSubNode->next; - continue; - } - - std::string aContent = (const char*)aNodeContent; - - // Tag test_component_name - if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_name) ) - _aModule.name = aContent; - - // Tag test_component_username - if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_username) ) - _aModule.username = aContent; - - // Tag test_component_type - if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_type) ) { - std::string aType = aContent; - - if ((aType.compare("MESH") == 0) || - (aType.compare("Mesh") == 0) || - (aType.compare("mesh") == 0)) - _aModule.type = MESH ; - else if((aType.compare("MED") == 0) || - (aType.compare("Med") == 0) || - (aType.compare("med") == 0)) - _aModule.type = Med ; - else if((aType.compare("GEOM") == 0) || - (aType.compare("Geom") == 0) || - (aType.compare("geom") == 0)) - _aModule.type = GEOM ; - else if((aType.compare("SOLVER") == 0) || - (aType.compare("Solver") == 0) || - (aType.compare("solver") == 0)) - _aModule.type = SOLVER ; - else if((aType.compare("SUPERV") == 0) || - (aType.compare("Superv") == 0) || - (aType.compare("Supervision") == 0) || - (aType.compare("superv") == 0)) - _aModule.type = SUPERV ; - else if((aType.compare("DATA") == 0) || - (aType.compare("Data") == 0) || - (aType.compare("data") == 0)) - _aModule.type = DATA ; - else if((aType.compare("VISU") == 0) || - (aType.compare("Visu") == 0) || - (aType.compare("visu") == 0)) - _aModule.type = VISU ; - else if((aType.compare("OTHER") == 0) || - (aType.compare("Other") == 0) || - (aType.compare("other") == 0)) - _aModule.type = OTHER ; - else - // If it'not in all theses cases, the type is affected to OTHER - _aModule.type = OTHER ; - } - - // Tag test_component_multistudy - if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_multistudy) ) - _aModule.multistudy = atoi( aContent.c_str() ); - - // Tag test_component_impltype - if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_impltype) ) - _aModule.implementationType = atoi(aContent.c_str()); - - // Tag test_component_icon - if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_icon) ) - _aModule.icon = aContent; - - // Tag test_component_version - if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_version) ) - _aModule.version = aContent; - - // Tag test_component_comment - if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_comment) ) - _aModule.comment = aContent; - - // Tag test_constraint - if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_constraint) ) - _aModule.constraint = aContent; - - xmlFree(aNodeContent); - - // Process tag test_interface_list: - if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_interface_list) ) { - - // Form an interface list for the component - xmlNodePtr aSubNode = aComponentSubNode->xmlChildrenNode; - while(aSubNode != NULL) { - // Tag test_interface_name - if ( !xmlStrcmp(aSubNode->name, (const xmlChar*)test_interface_name) ) { - xmlChar* anInterfaceName = xmlNodeGetContent(aSubNode); - if (anInterfaceName != NULL) { - _aInterface.name = (const char*)anInterfaceName; - xmlFree(anInterfaceName); - } - } - - // Tag test_service_list - if ( !xmlStrcmp(aSubNode->name, (const xmlChar*)test_service_list) ) { - // Form a service list for the interface - xmlNodePtr aCompServiceNode = aSubNode->xmlChildrenNode; - while(aCompServiceNode != NULL) { - // Tag test_service - if ( !xmlStrcmp(aCompServiceNode->name, (const xmlChar*)test_interface_name) ) { - xmlNodePtr aCompServiceSubNode = aCompServiceNode->xmlChildrenNode; - while(aCompServiceSubNode != NULL) { - - xmlChar* aCompServiceData = xmlNodeGetContent(aCompServiceSubNode); - - if ( aCompServiceData != NULL) { - - // Tag test_service_name - if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_service_name) ) - _aService.name = (const char*)aCompServiceData; - - // Tag test_defaultservice - if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_defaultservice) ) - _aService.byDefault = (const char*)aCompServiceData; - - // Tag test_typeofnode - if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_typeofnode) ) - _aService.typeOfNode = (const char*)aCompServiceData; - - xmlFree(aCompServiceData); - } - - // Tag test_inParameter_list - if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_inParameter_list) ) { - xmlNodePtr aParamNode = aCompServiceSubNode->xmlChildrenNode; - while(aParamNode != NULL) { - - // Tag test_inParameter - if (xmlStrcmp(aParamNode->name, (const xmlChar*)test_inParameter)) { - aParamNode = aParamNode->next; - continue; - } - - xmlNodePtr aParamItemNode = aParamNode->xmlChildrenNode; - while(aParamItemNode != NULL) { - - xmlChar* aParamData = xmlNodeGetContent(aParamItemNode); - - if (aParamData != NULL) { - - // Tag test_inParameter_name - if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_inParameter_name) ) - _inParam.name = (const char*)aParamData; - - // Tag test_inParameter_type - if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_inParameter_type) ) - _inParam.type = (const char*)aParamData; - - xmlFree(aParamData); - } - - aParamItemNode = aParamItemNode->next; - } - - _inParamList.push_back(_inParam) ; - - // Empty temporary structures - _inParam.type = ""; - _inParam.name = ""; - - aParamNode = aParamNode->next; - } - - _aService.inParameters = _inParamList; - _inParamList.resize(0); - } - - // Tag test_outParameter_list - if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_outParameter_list) ) { - xmlNodePtr aParamNode = aCompServiceSubNode->xmlChildrenNode; - while(aParamNode != NULL) { - - // Tag test_outParameter - if (xmlStrcmp(aParamNode->name, (const xmlChar*)test_outParameter)) { - aParamNode = aParamNode->next; - continue; - } - - xmlNodePtr aParamItemNode = aParamNode->xmlChildrenNode; - while(aParamItemNode != NULL) { - - xmlChar* anOutParamData = xmlNodeGetContent(aParamItemNode); - - if (anOutParamData != NULL) { - - // Tag test_outParameter_name - if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_outParameter_name) ) - _outParam.name = (const char*)anOutParamData; - - // Tag test_outParameter_type - if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_outParameter_type) ) - _outParam.type = (const char*)anOutParamData; - - xmlFree(anOutParamData); - } - - aParamItemNode = aParamItemNode->next; - } - - _outParamList.push_back(_outParam) ; - - // Empty temporary structures - _outParam.type = ""; - _outParam.name = ""; - - aParamNode = aParamNode->next; - } - - _aService.outParameters = _outParamList; - _outParamList.resize(0); - } - - //@ Tag test_inDataStreamParameter_list - if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_inDataStreamParameter_list) ) { - xmlNodePtr aParamNode = aCompServiceSubNode->xmlChildrenNode; - while(aParamNode != NULL) { - - // Tag test_inDataStreamParameter - if (xmlStrcmp(aParamNode->name, (const xmlChar*)test_inDataStreamParameter)) { - aParamNode = aParamNode->next; - continue; - } - - xmlNodePtr aParamItemNode = aParamNode->xmlChildrenNode; - while(aParamItemNode != NULL) { - - xmlChar* inDataStreamParamData = xmlNodeGetContent(aParamItemNode); - - if (inDataStreamParamData != NULL) { - - // Tag test_inDataStreamParameter_name - if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_inDataStreamParameter_name) ) - _inDataStreamParam.name = (const char*)inDataStreamParamData; - - // Tag test_inDataStreamParameter_type - if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_inDataStreamParameter_type) ) - _inDataStreamParam.type = (const char*)inDataStreamParamData; - - // Tag test_inDataStreamParameter_dependency - if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_inDataStreamParameter_dependency) ) - _inDataStreamParam.dependency = (const char*)inDataStreamParamData; - - xmlFree(inDataStreamParamData); - } - - aParamItemNode = aParamItemNode->next; - } - - _inDataStreamParamList.push_back(_inDataStreamParam) ; - - // Empty temporary structures - _inDataStreamParam.type = ""; - _inDataStreamParam.name = ""; - _inDataStreamParam.dependency = ""; - - aParamNode = aParamNode->next; - } - - _aService.inDataStreamParameters = _inDataStreamParamList; - _inDataStreamParamList.resize(0); - } - - // Tag test_outDataStreamParameter_list - if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_outDataStreamParameter_list) ) { - xmlNodePtr aParamNode = aCompServiceSubNode->xmlChildrenNode; - while(aParamNode != NULL) { - - // Tag test_outDataStreamParameter - if (xmlStrcmp(aParamNode->name, (const xmlChar*)test_outDataStreamParameter)) { - aParamNode = aParamNode->next; - continue; - } - - xmlNodePtr aParamItemNode = aParamNode->xmlChildrenNode; - while(aParamItemNode != NULL) { - - xmlChar* outDataStreamParamData = xmlNodeGetContent(aParamItemNode); - - if (outDataStreamParamData != NULL) { - - // Tag test_outDataStreamParameter_name - if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_outDataStreamParameter_name) ) - _outDataStreamParam.name = (const char*)outDataStreamParamData; - - // Tag test_outDataStreamParameter_type - if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_outDataStreamParameter_type) ) - _outDataStreamParam.type = (const char*)outDataStreamParamData; - - // Tag test_outDataStreamParameter_dependency - if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_outDataStreamParameter_dependency) ) - _outDataStreamParam.dependency = (const char*)outDataStreamParamData; - - xmlFree(outDataStreamParamData); - } - - aParamItemNode = aParamItemNode->next; - } - - _outDataStreamParamList.push_back(_outDataStreamParam) ; - - // Empty temporary structures - _outDataStreamParam.type = ""; - _outDataStreamParam.name = ""; - _outDataStreamParam.dependency = ""; - - aParamNode = aParamNode->next; - } - - _aService.outDataStreamParameters = _outDataStreamParamList; - _outDataStreamParamList.resize(0); - } - - aCompServiceSubNode = aCompServiceSubNode->next; - } - - - // Put formed service into the list - _serviceList.push_back(_aService); - - // Empty temporary structures - _aService.name = ""; - _aService.typeOfNode = 1; - _aService.inParameters.resize(0); - _aService.outParameters.resize(0); - _aService.inDataStreamParameters.resize(0); - _aService.outDataStreamParameters.resize(0); - } - - aCompServiceNode = aCompServiceNode->next; - } - - _aInterface.services = _serviceList ; - - // Empty temporary structures - _serviceList.resize(0); - _interfaceList.push_back(_aInterface); - _aInterface.name =""; - _aInterface.services.resize(0); - } - - aSubNode = aSubNode->next; - } - - _aModule.interfaces = _interfaceList ; - _interfaceList.resize(0); - } - - - aComponentSubNode = aComponentSubNode->next; - } - - - aComponentNode = aComponentNode->next; - } - } - - - aCurNode = aCurNode->next; + xmlNodePtr aCurSubNode = aCurNode->xmlChildrenNode; + while(aCurSubNode != NULL) + { + // Forming a PathPrefix structure (tag test_path_prefix) + if ( xmlStrcmp(aCurSubNode->name, (const xmlChar*)test_path_prefix) ) { + aCurSubNode = aCurSubNode->next; + continue; + } + + xmlNodePtr aCurSubSubNode = aCurSubNode->xmlChildrenNode; + while(aCurSubSubNode != NULL) + { + // Tag test_path_prefix_name + if ( !xmlStrcmp(aCurSubSubNode->name, (const xmlChar*)test_path_prefix_name) ) { + xmlChar* aPath = xmlNodeGetContent(aCurSubSubNode); + if (aPath != NULL) { + _pathPrefix.path = (const char*)aPath; + xmlFree(aPath); + } + } + + // Tag test_computer_list + if ( !xmlStrcmp(aCurSubSubNode->name, (const xmlChar*)test_computer_list) ) { + xmlNodePtr aComputerNode = aCurSubSubNode->xmlChildrenNode; + while (aComputerNode != NULL) { + // Tag test_computer_name + if ( !xmlStrcmp(aComputerNode->name, (const xmlChar*) test_computer_name) ) { + xmlChar* aCompName = xmlNodeGetContent(aComputerNode); + if (aCompName != NULL) { + _pathPrefix.listOfComputer.push_back((const char*)aCompName); + xmlFree(aCompName); + } + } + + aComputerNode = aComputerNode->next; + } + } + + aCurSubSubNode = aCurSubSubNode->next; + } + + _pathList.push_back(_pathPrefix); + _pathPrefix.listOfComputer.resize(0); + + aCurSubNode = aCurSubNode->next; + } } + + //@ Process list of components (tag test_component_list) + if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_component_list) ) + { + xmlNodePtr aComponentNode = aCurNode->xmlChildrenNode; + while (aComponentNode != NULL) + { + // Do not process tags differ from test_component here + if ( xmlStrcmp(aComponentNode->name, (const xmlChar*)test_component) ) { + aComponentNode = aComponentNode->next; + continue; + } + + // Component identification + + // Empty temporary structures + _aModule.name = ""; + _aModule.constraint = ""; + _aModule.icon=""; + _aModule.interfaces.resize(0); + + xmlNodePtr aComponentSubNode = aComponentNode->xmlChildrenNode; + while(aComponentSubNode != NULL) + { + xmlChar* aNodeContent = xmlNodeGetContent(aComponentSubNode); + + if (aNodeContent == NULL) { + aComponentSubNode = aComponentSubNode->next; + continue; + } + + std::string aContent = (const char*)aNodeContent; + + // Tag test_component_name + if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_name) ) + _aModule.name = aContent; + + // Tag test_component_username + if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_username) ) + _aModule.username = aContent; + + // Tag test_component_type + if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_type) ) { + std::string aType = aContent; + + if ((aType.compare("MESH") == 0) || + (aType.compare("Mesh") == 0) || + (aType.compare("mesh") == 0)) + _aModule.type = MESH ; + else if((aType.compare("MED") == 0) || + (aType.compare("Med") == 0) || + (aType.compare("med") == 0)) + _aModule.type = Med ; + else if((aType.compare("GEOM") == 0) || + (aType.compare("Geom") == 0) || + (aType.compare("geom") == 0)) + _aModule.type = GEOM ; + else if((aType.compare("SOLVER") == 0) || + (aType.compare("Solver") == 0) || + (aType.compare("solver") == 0)) + _aModule.type = SOLVER ; + else if((aType.compare("SUPERV") == 0) || + (aType.compare("Superv") == 0) || + (aType.compare("Supervision") == 0) || + (aType.compare("superv") == 0)) + _aModule.type = SUPERV ; + else if((aType.compare("DATA") == 0) || + (aType.compare("Data") == 0) || + (aType.compare("data") == 0)) + _aModule.type = DATA ; + else if((aType.compare("VISU") == 0) || + (aType.compare("Visu") == 0) || + (aType.compare("visu") == 0)) + _aModule.type = VISU ; + else if((aType.compare("OTHER") == 0) || + (aType.compare("Other") == 0) || + (aType.compare("other") == 0)) + _aModule.type = OTHER ; + else + // If it'not in all theses cases, the type is affected to OTHER + _aModule.type = OTHER ; + } + + // Tag test_component_multistudy + if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_multistudy) ) + _aModule.multistudy = atoi( aContent.c_str() ); + + // Tag test_component_impltype + if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_impltype) ) + _aModule.implementationType = atoi(aContent.c_str()); + + // Tag test_component_icon + if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_icon) ) + _aModule.icon = aContent; + + // Tag test_component_version + if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_version) ) + _aModule.version = aContent; + + // Tag test_component_comment + if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_comment) ) + _aModule.comment = aContent; + + // Tag test_constraint + if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_constraint) ) + _aModule.constraint = aContent; + + xmlFree(aNodeContent); + + // Process tag test_interface_list: + if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_interface_list) ) { + + // Form an interface list for the component + xmlNodePtr aSubNode = aComponentSubNode->xmlChildrenNode; + while(aSubNode != NULL) { + // Tag test_interface_name + if ( !xmlStrcmp(aSubNode->name, (const xmlChar*)test_interface_name) ) { + xmlChar* anInterfaceName = xmlNodeGetContent(aSubNode); + if (anInterfaceName != NULL) { + _aInterface.name = (const char*)anInterfaceName; + xmlFree(anInterfaceName); + } + } + + // Tag test_service_list + if ( !xmlStrcmp(aSubNode->name, (const xmlChar*)test_service_list) ) { + // Form a service list for the interface + xmlNodePtr aCompServiceNode = aSubNode->xmlChildrenNode; + while(aCompServiceNode != NULL) { + // Tag test_service + if ( !xmlStrcmp(aCompServiceNode->name, (const xmlChar*)test_interface_name) ) { + xmlNodePtr aCompServiceSubNode = aCompServiceNode->xmlChildrenNode; + while(aCompServiceSubNode != NULL) + { + xmlChar* aCompServiceData = xmlNodeGetContent(aCompServiceSubNode); + + if ( aCompServiceData != NULL) + { + // Tag test_service_name + if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_service_name) ) + _aService.name = (const char*)aCompServiceData; + + // Tag test_defaultservice + if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_defaultservice) ) + _aService.byDefault = (const char*)aCompServiceData; + + // Tag test_typeofnode + if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_typeofnode) ) + _aService.typeOfNode = (const char*)aCompServiceData; + + xmlFree(aCompServiceData); + } + + // Tag test_inParameter_list + if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_inParameter_list) ) { + xmlNodePtr aParamNode = aCompServiceSubNode->xmlChildrenNode; + while (aParamNode != NULL) + { + // Tag test_inParameter + if (xmlStrcmp(aParamNode->name, (const xmlChar*)test_inParameter)) { + aParamNode = aParamNode->next; + continue; + } + + xmlNodePtr aParamItemNode = aParamNode->xmlChildrenNode; + while (aParamItemNode != NULL) + { + xmlChar* aParamData = xmlNodeGetContent(aParamItemNode); + + if (aParamData != NULL) + { + // Tag test_inParameter_name + if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_inParameter_name) ) + _inParam.name = (const char*)aParamData; + + // Tag test_inParameter_type + if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_inParameter_type) ) + _inParam.type = (const char*)aParamData; + + xmlFree(aParamData); + } + + aParamItemNode = aParamItemNode->next; + } + + _inParamList.push_back(_inParam) ; + + // Empty temporary structures + _inParam.type = ""; + _inParam.name = ""; + + aParamNode = aParamNode->next; + } + + _aService.inParameters = _inParamList; + _inParamList.resize(0); + } + + // Tag test_outParameter_list + if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_outParameter_list) ) { + xmlNodePtr aParamNode = aCompServiceSubNode->xmlChildrenNode; + while (aParamNode != NULL) + { + // Tag test_outParameter + if (xmlStrcmp(aParamNode->name, (const xmlChar*)test_outParameter)) { + aParamNode = aParamNode->next; + continue; + } + + xmlNodePtr aParamItemNode = aParamNode->xmlChildrenNode; + while (aParamItemNode != NULL) + { + xmlChar* anOutParamData = xmlNodeGetContent(aParamItemNode); + + if (anOutParamData != NULL) + { + // Tag test_outParameter_name + if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_outParameter_name) ) + _outParam.name = (const char*)anOutParamData; + + // Tag test_outParameter_type + if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_outParameter_type) ) + _outParam.type = (const char*)anOutParamData; + + xmlFree(anOutParamData); + } + + aParamItemNode = aParamItemNode->next; + } + + _outParamList.push_back(_outParam) ; + + // Empty temporary structures + _outParam.type = ""; + _outParam.name = ""; + + aParamNode = aParamNode->next; + } + + _aService.outParameters = _outParamList; + _outParamList.resize(0); + } + + //@ Tag test_inDataStreamParameter_list + if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_inDataStreamParameter_list) ) + { + xmlNodePtr aParamNode = aCompServiceSubNode->xmlChildrenNode; + while (aParamNode != NULL) + { + // Tag test_inDataStreamParameter + if (xmlStrcmp(aParamNode->name, (const xmlChar*)test_inDataStreamParameter)) { + aParamNode = aParamNode->next; + continue; + } + + xmlNodePtr aParamItemNode = aParamNode->xmlChildrenNode; + while (aParamItemNode != NULL) + { + xmlChar* inDataStreamParamData = xmlNodeGetContent(aParamItemNode); + + if (inDataStreamParamData != NULL) + { + // Tag test_inDataStreamParameter_name + if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_inDataStreamParameter_name) ) + _inDataStreamParam.name = (const char*)inDataStreamParamData; + + // Tag test_inDataStreamParameter_type + if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_inDataStreamParameter_type) ) + _inDataStreamParam.type = (const char*)inDataStreamParamData; + + // Tag test_inDataStreamParameter_dependency + if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_inDataStreamParameter_dependency) ) + _inDataStreamParam.dependency = (const char*)inDataStreamParamData; + + xmlFree(inDataStreamParamData); + } + + aParamItemNode = aParamItemNode->next; + } + + _inDataStreamParamList.push_back(_inDataStreamParam) ; + + // Empty temporary structures + _inDataStreamParam.type = ""; + _inDataStreamParam.name = ""; + _inDataStreamParam.dependency = ""; + + aParamNode = aParamNode->next; + } + + _aService.inDataStreamParameters = _inDataStreamParamList; + _inDataStreamParamList.resize(0); + } + + // Tag test_outDataStreamParameter_list + if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_outDataStreamParameter_list) ) + { + xmlNodePtr aParamNode = aCompServiceSubNode->xmlChildrenNode; + while (aParamNode != NULL) + { + // Tag test_outDataStreamParameter + if (xmlStrcmp(aParamNode->name, (const xmlChar*)test_outDataStreamParameter)) { + aParamNode = aParamNode->next; + continue; + } + + xmlNodePtr aParamItemNode = aParamNode->xmlChildrenNode; + while (aParamItemNode != NULL) + { + xmlChar* outDataStreamParamData = xmlNodeGetContent(aParamItemNode); + + if (outDataStreamParamData != NULL) + { + // Tag test_outDataStreamParameter_name + if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_outDataStreamParameter_name) ) + _outDataStreamParam.name = (const char*)outDataStreamParamData; + + // Tag test_outDataStreamParameter_type + if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_outDataStreamParameter_type) ) + _outDataStreamParam.type = (const char*)outDataStreamParamData; + + // Tag test_outDataStreamParameter_dependency + if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_outDataStreamParameter_dependency) ) + _outDataStreamParam.dependency = (const char*)outDataStreamParamData; + + xmlFree(outDataStreamParamData); + } + + aParamItemNode = aParamItemNode->next; + } + + _outDataStreamParamList.push_back(_outDataStreamParam) ; + + // Empty temporary structures + _outDataStreamParam.type = ""; + _outDataStreamParam.name = ""; + _outDataStreamParam.dependency = ""; + + aParamNode = aParamNode->next; + } + + _aService.outDataStreamParameters = _outDataStreamParamList; + _outDataStreamParamList.resize(0); + } + + aCompServiceSubNode = aCompServiceSubNode->next; + } + + // Put formed service into the list + _serviceList.push_back(_aService); + + // Empty temporary structures + _aService.name = ""; + _aService.typeOfNode = 1; + _aService.inParameters.resize(0); + _aService.outParameters.resize(0); + _aService.inDataStreamParameters.resize(0); + _aService.outDataStreamParameters.resize(0); + } + + aCompServiceNode = aCompServiceNode->next; + } + + _aInterface.services = _serviceList ; + + // Empty temporary structures + _serviceList.resize(0); + _interfaceList.push_back(_aInterface); + _aInterface.name =""; + _aInterface.services.resize(0); + } + + aSubNode = aSubNode->next; + } + + _aModule.interfaces = _interfaceList ; + _interfaceList.resize(0); + } + + aComponentSubNode = aComponentSubNode->next; + } + + _moduleList.push_back(_aModule); + + aComponentNode = aComponentNode->next; + } + } + + aCurNode = aCurNode->next; + } } diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx index 74640bc3c..819e342b7 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx @@ -500,7 +500,7 @@ SALOME_ModuleCatalogImpl::GetComponent(const char* name) std::string s(name); ParserComponent *C_parser = NULL; - ParserPathPrefixes *pp = NULL; + //ParserPathPrefixes *pp = NULL; SALOME_ModuleCatalog::Acomponent_ptr compo = SALOME_ModuleCatalog::Acomponent::_nil(); -- 2.39.2