1 // SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SALOME_ModuleCatalog_impl.cxx
25 // Author : Estelle Deville
30 #include "SALOME_ModuleCatalog_impl.hxx"
31 #include "SALOME_ModuleCatalog_Acomponent_impl.hxx"
34 #include <qstringlist.h>
35 #include <qfileinfo.h>
37 static const char* SEPARATOR = ":";
39 //----------------------------------------------------------------------
40 // Function : SALOME_ModuleCatalogImpl
41 // Purpose : Constructor
42 //----------------------------------------------------------------------
43 SALOME_ModuleCatalogImpl::SALOME_ModuleCatalogImpl(int argc, char** argv)
45 MESSAGE("Catalog creation");
47 // Empty used variables
48 _general_module_list.resize(0);
49 _general_path_list.resize(0);
51 _personal_module_list.resize(0);
52 _personal_path_list.resize(0);
54 // Parse the arguments given at server run
55 if (!_parseArguments(argc, argv,&_general_path,&_personal_path))
56 MESSAGE( "Error while argument parsing" )
58 // Test existency of files
59 if (_general_path == NULL)
60 MESSAGE( "Error the general catalog should be indicated" )
63 //MESSAGE("Parse general catalog");
64 // Affect the variables _general_module_list and _general_path_list
65 // with the common catalog
67 QStringList dirList = QStringList::split( SEPARATOR, _general_path, false ); // skip empty entries
68 for ( int i = 0; i < dirList.count(); i++ ) {
69 QFileInfo fileInfo( dirList[ i ] );
70 if ( fileInfo.isFile() && fileInfo.exists() ) {
71 _parse_xml_file(fileInfo.filePath(),_general_module_list, _general_path_list);
75 // Verification of _general_path_list content
76 if(!_verify_path_prefix(_general_path_list))
77 MESSAGE( "Error while parsing the general path list, differents pathes are associated to one computer, the first will be choosen" )
78 else MESSAGE("General path list OK");
80 if(_personal_path != NULL)
82 //MESSAGE("Parse personal catalog");
83 // Affect the variables _personal_module_list and _personal_path_list
84 // with the personal catalog
85 _parse_xml_file(_personal_path,_personal_module_list, _personal_path_list);
87 // Verification of _general_path_list content
88 if(!_verify_path_prefix(_personal_path_list))
89 MESSAGE("Error while parsing the personal path list, differents pathes are associated to one computer, the first will be choosen" )
90 else MESSAGE("Personal path list OK");
92 else MESSAGE("No personal catalog indicated or error while opening the personal catalog");
96 //----------------------------------------------------------------------
97 // Function : ~SALOME_ModuleCatalogImpl
98 // Purpose : Destructor
99 //----------------------------------------------------------------------
100 SALOME_ModuleCatalogImpl::~SALOME_ModuleCatalogImpl()
102 MESSAGE("Catalog Destruction");
106 //----------------------------------------------------------------------
107 // Function : GetComputerList
108 // Purpose : get a computer list
109 //----------------------------------------------------------------------
110 SALOME_ModuleCatalog::ListOfComputers*
111 SALOME_ModuleCatalogImpl::GetComputerList()
113 SALOME_ModuleCatalog::ListOfComputers_var _list_computers =
114 new SALOME_ModuleCatalog::ListOfComputers;
115 return _list_computers._retn();
118 //----------------------------------------------------------------------
119 // Function : GetPathPrefix
120 // Purpose : get the PathPrefix of a computer
121 //----------------------------------------------------------------------
123 SALOME_ModuleCatalogImpl::GetPathPrefix(const char* machinename) {
124 MESSAGE("Begin of GetPathPrefix")
125 // Variables initialisation
129 // Parse all the path prefixes
130 // looking for the wanted computer
131 for (unsigned int ind = 0 ; ind < _personal_path_list.size() ; ind++)
133 for (unsigned int ind1 = 0 ; ind1 < _personal_path_list[ind].ListOfComputer.size() ; ind1++)
135 if (strcmp(machinename, _personal_path_list[ind].ListOfComputer[ind1].c_str()) == 0)
139 // affect the path to be returned
140 const char* _temp = _personal_path_list[ind].path.c_str() ;
141 _path = new char[strlen(_temp)+1];
149 for (unsigned int ind = 0 ; ind < _general_path_list.size() ; ind++)
151 for (unsigned int ind1 = 0 ; ind1 < _general_path_list[ind].ListOfComputer.size() ; ind1++)
153 if (strcmp(machinename, _general_path_list[ind].ListOfComputer[ind1].c_str()) == 0)
157 // affect the path to be returned
158 const char* _temp = _general_path_list[ind].path.c_str() ;
159 _path = new char[strlen(_temp)+1];
169 //----------------------------------------------------------------------
170 // Function : GetComponentList
171 // Purpose : get a component list
172 // If a component is defined in the personal catalog and
173 // in the general catalog (same name), the component defined
174 // in the personal catalog is used
175 //----------------------------------------------------------------------
176 SALOME_ModuleCatalog::ListOfComponents*
177 SALOME_ModuleCatalogImpl::GetComponentList()
179 MESSAGE("Begin of GetComponentList");
180 SALOME_ModuleCatalog::ListOfComponents_var _list_components =
181 new SALOME_ModuleCatalog::ListOfComponents;
183 _list_components->length(_personal_module_list.size());
185 // All the components defined in the personal catalog are taken
186 for (unsigned int ind=0; ind < _personal_module_list.size();ind++)
188 _list_components[ind]=(_personal_module_list[ind].Parsercomponentname).c_str();
189 SCRUTE(_list_components[ind]) ;
192 int indice = _personal_module_list.size() ;
195 // The components in the general catalog are taken only if they're
196 // not defined in the personal catalog
197 for (unsigned int ind=0; ind < _general_module_list.size();ind++)
200 for (unsigned int ind1=0; ind1 < _personal_module_list.size();ind1++)
202 // searching if the component is already defined in
203 // the personal catalog
204 if ((_general_module_list[ind].Parsercomponentname.compare(_personal_module_list[ind1].Parsercomponentname)) == 0)
209 MESSAGE("A new component " << _general_module_list[ind].Parsercomponentname << " has to be to added in the list");
210 _list_components->length(indice+1);
211 // The component is not already defined => has to be taken
212 _list_components[indice]=(_general_module_list[ind].Parsercomponentname).c_str();
213 SCRUTE(_list_components[indice]) ;
218 MESSAGE("The component " <<_general_module_list[ind].Parsercomponentname << " was already defined in the personal catalog") ;
221 MESSAGE ( "End of GetComponentList" )
222 return _list_components._retn();
226 //----------------------------------------------------------------------
227 // Function : GetComponentIconeList
228 // Purpose : get a component list of component name and component icone
229 // If a component is defined in the personal catalog and
230 // in the general catalog (same name), the component defined
231 // in the personal catalog is used
232 //----------------------------------------------------------------------
233 SALOME_ModuleCatalog::ListOfIAPP_Affich*
234 SALOME_ModuleCatalogImpl::GetComponentIconeList()
236 MESSAGE("Begin of GetComponentIconeList");
238 SALOME_ModuleCatalog::ListOfIAPP_Affich_var _list_components_icone =
239 new SALOME_ModuleCatalog::ListOfIAPP_Affich;
241 _list_components_icone->length(_personal_module_list.size());
243 // All the components defined in the personal catalog are taken
244 for (unsigned int ind=0; ind < _personal_module_list.size();ind++)
246 _list_components_icone[ind].modulename=(_personal_module_list[ind].Parsercomponentname).c_str();
247 _list_components_icone[ind].moduleusername=(_personal_module_list[ind].Parsercomponentusername).c_str();
248 _list_components_icone[ind].moduleicone=(_personal_module_list[ind].Parsercomponenticone).c_str();
249 //SCRUTE(_list_components_icone[ind].modulename);
250 //SCRUTE(_list_components_icone[ind].moduleicone);
253 int indice = _personal_module_list.size() ;
256 // The components in the general catalog are taken only if they're
257 // not defined in the personal catalog
258 for (unsigned int ind=0; ind < _general_module_list.size();ind++)
261 for (unsigned int ind1=0; ind1 < _personal_module_list.size();ind1++)
263 // searching if the component is aleready defined in
264 // the personal catalog
265 if ((_general_module_list[ind].Parsercomponentname.compare(_personal_module_list[ind1].Parsercomponentname)) == 0)
270 // MESSAGE("A new component " << _general_module_list[ind].Parsercomponentname << " has to be to added in the list");
271 _list_components_icone->length(indice+1);
272 // The component is not already defined => has to be taken
273 _list_components_icone[indice].modulename=(_general_module_list[ind].Parsercomponentname).c_str();
274 _list_components_icone[indice].moduleusername=(_general_module_list[ind].Parsercomponentusername).c_str();
275 _list_components_icone[indice].moduleicone=(_general_module_list[ind].Parsercomponenticone).c_str();
276 //SCRUTE(_list_components_icone[indice].modulename) ;
277 //SCRUTE(_list_components_icone[indice].moduleicone);
282 //MESSAGE("The component " <<_general_module_list[ind].Parsercomponentname << " was already defined in the personal catalog");
285 return _list_components_icone._retn() ;
288 //----------------------------------------------------------------------
289 // Function : GetTypedComponentList
290 // Purpose : get a component list of a wanted type
291 // If a component is defined in the personal catalog and
292 // in the general catalog (same name), the component defined
293 // in the personal catalog is used
294 //----------------------------------------------------------------------
295 SALOME_ModuleCatalog::ListOfComponents*
296 SALOME_ModuleCatalogImpl::GetTypedComponentList(SALOME_ModuleCatalog::ComponentType component_type)
298 MESSAGE("Begin of GetTypedComponentList");
299 SALOME_ModuleCatalog::ListOfComponents_var _list_typed_component =
300 new SALOME_ModuleCatalog::ListOfComponents;
303 _list_typed_component->length(0);
304 // Transform SALOME_ModuleCatalog::ComponentType in ParserComponentType
305 ParserComponentType _temp_component_type;
306 switch(component_type){
307 case SALOME_ModuleCatalog::GEOM:
308 _temp_component_type = GEOM ;
310 case SALOME_ModuleCatalog::MESH:
311 _temp_component_type = MESH;
313 case SALOME_ModuleCatalog::Med:
314 _temp_component_type = Med;
316 case SALOME_ModuleCatalog::SOLVER:
317 _temp_component_type = SOLVER;
319 case SALOME_ModuleCatalog::DATA:
320 _temp_component_type = DATA;
322 case SALOME_ModuleCatalog::VISU:
323 _temp_component_type = VISU;
325 case SALOME_ModuleCatalog::SUPERV:
326 _temp_component_type = SUPERV;
328 case SALOME_ModuleCatalog::OTHER:
329 _temp_component_type = OTHER;
333 // All the components in the personal catalog are taken
334 for (unsigned int ind=0; ind < _personal_module_list.size();ind++)
336 if (_personal_module_list[ind].Parsercomponenttype == _temp_component_type)
338 _list_typed_component->length(_j + 1);
339 _list_typed_component[_j] = (_modulelist[ind].Parsercomponentname).c_str();
340 //SCRUTE(_list_typed_component[_j])
345 int indice = _list_typed_component->length() ;
348 // The components in the general catalog are taken only if they're
349 // not defined in the personal catalog
350 for (unsigned int ind=0; ind < _general_module_list.size();ind++)
354 if(_general_module_list[ind].Parsercomponenttype == _temp_component_type)
356 for (unsigned int ind1=0; ind1 < _personal_module_list.size();ind1++)
358 // searching if the component is aleready defined in
359 // the personal catalog
360 if ((_general_module_list[ind].Parsercomponentname.compare(_personal_module_list[ind1].Parsercomponentname)) == 0)
365 //MESSAGE("A new component " << _general_module_list[ind].Parsercomponentname << " has to be to added in the list");
366 _list_typed_component->length(indice+1);
367 // The component is not already defined => has to be taken
368 _list_typed_component[indice]=(_general_module_list[ind].Parsercomponentname).c_str();
369 //SCRUTE(_list_typed_component[indice]) ;
374 //MESSAGE("The component " <<_general_module_list[ind].Parsercomponentname << " was already defined in the personal catalog") ;
379 return _list_typed_component._retn();
382 //----------------------------------------------------------------------
383 // Function : GetComponent
384 // Purpose : get a component
385 // If a component is defined in the personal catalog and
386 // in the general catalog (same name), the component defined
387 // in the personal catalog is used
388 //----------------------------------------------------------------------
389 SALOME_ModuleCatalog::Acomponent_ptr
390 SALOME_ModuleCatalogImpl::GetComponent(const char* componentname)
392 SALOME_ModuleCatalog::Acomponent_ptr compo;
393 SALOME_ModuleCatalog::ListOfDefInterface _list_interfaces;
394 _list_interfaces.length(0);
395 char* _constraint = NULL;
397 char* _componentusername = NULL;
398 SALOME_ModuleCatalog::ComponentType _componenttype = SALOME_ModuleCatalog::OTHER; // default initialisation
399 CORBA::Boolean _componentmultistudy = false ; // default initialisation
400 ListOfPathPrefix _pathes ;
406 // Looking for component named "componentname" in the personal catalog
407 // If found, get name, interfaces and constraint
408 // If not found, looking for component named "componentname" in
409 // the general catalog
410 // If found, get name, interfaces and constraint
411 // If not found, NULL pointer is returned
413 for (unsigned int ind=0; ind < _personal_module_list.size();ind++)
415 if (strcmp((_personal_module_list[ind].Parsercomponentname).c_str(),componentname) == 0)
417 //MESSAGE("Component named " << componentname << " found in the personal catalog");
421 _constraint = new char[strlen(_personal_module_list[ind].Parserconstraint.c_str()) + 1];
422 _constraint = CORBA::string_dup(_personal_module_list[ind].Parserconstraint.c_str());
424 // get component type
425 switch(_personal_module_list[ind].Parsercomponenttype){
427 _componenttype = SALOME_ModuleCatalog::GEOM;
430 _componenttype = SALOME_ModuleCatalog::MESH;
433 _componenttype = SALOME_ModuleCatalog::Med;
436 _componenttype = SALOME_ModuleCatalog::SOLVER;
439 _componenttype = SALOME_ModuleCatalog::DATA;
442 _componenttype = SALOME_ModuleCatalog::VISU;
445 _componenttype = SALOME_ModuleCatalog::SUPERV;
448 _componenttype = SALOME_ModuleCatalog::OTHER;
452 // get component multistudy
453 _componentmultistudy = _personal_module_list[ind].Parsercomponentmultistudy ;
455 // get component icone
456 _icone = CORBA::string_dup(_personal_module_list[ind].Parsercomponenticone.c_str());
458 // get component user name
459 _componentusername = CORBA::string_dup(_personal_module_list[ind].Parsercomponentusername.c_str());
461 // get component interfaces
462 _list_interfaces = duplicate_interfaces(_personal_module_list[ind].ParserListInterface);
465 _pathes = duplicate_pathes(_personal_path_list);
472 SALOME_ModuleCatalog_AcomponentImpl* aComponentImpl =
473 new SALOME_ModuleCatalog_AcomponentImpl(componentname,
477 _componentmultistudy,
482 compo = aComponentImpl->_this();
485 // Not found in the personal catalog => searching in the general catalog
487 for (unsigned int ind=0; ind < _general_module_list.size();ind++)
489 if (strcmp((_general_module_list[ind].Parsercomponentname).c_str(),componentname) == 0)
491 //MESSAGE("Component named " << componentname << " found in the general catalog");
495 _constraint = new char[strlen(_general_module_list[ind].Parserconstraint.c_str()) + 1];
496 _constraint = CORBA::string_dup(_general_module_list[ind].Parserconstraint.c_str());
499 // get component type
500 switch(_general_module_list[ind].Parsercomponenttype){
502 _componenttype = SALOME_ModuleCatalog::GEOM;
505 _componenttype = SALOME_ModuleCatalog::MESH;
508 _componenttype = SALOME_ModuleCatalog::Med;
511 _componenttype = SALOME_ModuleCatalog::SOLVER;
514 _componenttype = SALOME_ModuleCatalog::DATA;
517 _componenttype = SALOME_ModuleCatalog::VISU;
520 _componenttype = SALOME_ModuleCatalog::SUPERV;
523 _componenttype = SALOME_ModuleCatalog::OTHER;
528 // get component multistudy
529 _componentmultistudy = _general_module_list[ind].Parsercomponentmultistudy ;
531 // get component icone
532 _icone = CORBA::string_dup(_general_module_list[ind].Parsercomponenticone.c_str());
534 // get component user name
535 _componentusername = CORBA::string_dup(_general_module_list[ind].Parsercomponentusername.c_str());
537 // get component interfaces
538 _list_interfaces = duplicate_interfaces(_general_module_list[ind].ParserListInterface);
541 _pathes = duplicate_pathes(_general_path_list);
547 SALOME_ModuleCatalog_AcomponentImpl* aComponentImpl =
548 new SALOME_ModuleCatalog_AcomponentImpl(componentname,
552 _componentmultistudy,
557 compo = aComponentImpl->_this();
560 // Not found in the personal catalog and in the general catalog
561 // return NULL object
563 MESSAGE("Component with name " << componentname << " not found in catalog");
570 //----------------------------------------------------------------------
571 // Function : _parse_xml_file
572 // Purpose : parse one module catalog
573 //----------------------------------------------------------------------
575 SALOME_ModuleCatalogImpl::_parse_xml_file(const char* file,
576 ListOfParserComponent& modulelist,
577 ListOfParserPathPrefix& pathlist)
579 SALOME_ModuleCatalog_Handler* handler = new SALOME_ModuleCatalog_Handler();
582 QXmlInputSource source(xmlFile);
584 QXmlSimpleReader reader;
585 reader.setContentHandler( handler );
586 reader.setErrorHandler( handler );
587 reader.parse( source );
590 for ( ind = 0; ind < _modulelist.size(); ind++)
591 modulelist.push_back(_modulelist[ind]) ;
592 for ( ind = 0; ind < _pathlist.size(); ind++)
593 pathlist.push_back(_pathlist[ind]) ;
596 //----------------------------------------------------------------------
597 // Function : duplicate_interfaces
598 // Purpose : create a list of interfaces from the parsing of the catalog
599 //----------------------------------------------------------------------
600 SALOME_ModuleCatalog::ListOfDefInterface
601 SALOME_ModuleCatalogImpl::duplicate_interfaces(ListOfDefinitionInterface list_interface)
603 SALOME_ModuleCatalog::ListOfDefInterface _list_interfaces;
604 unsigned int _length_interfaces = list_interface.size();
605 _list_interfaces.length(_length_interfaces);
607 for (unsigned int ind = 0; ind < _length_interfaces; ind++)
609 //duplicate interface name
610 _list_interfaces[ind].interfacename = CORBA::string_dup(list_interface[ind].Parserinterfacename.c_str());
612 // duplicate service list
613 unsigned int _length_services = list_interface[ind].Parserinterfaceservicelist.size();
614 _list_interfaces[ind].interfaceservicelist.length(_length_services);
616 for (unsigned int ind1 = 0; ind1 < _length_services ; ind1 ++)
618 // duplicate service name
619 _list_interfaces[ind].interfaceservicelist[ind1].ServiceName =
620 CORBA::string_dup(list_interface[ind].Parserinterfaceservicelist[ind1].ParserServiceName.c_str());
622 // duplicate service by default
623 _list_interfaces[ind].interfaceservicelist[ind1].Servicebydefault =
624 list_interface[ind].Parserinterfaceservicelist[ind1].ParserServicebydefault;
626 // duplicate in Parameters
627 unsigned int _length_in_param = list_interface[ind].Parserinterfaceservicelist[ind1].ParserServiceinParameter.size();
628 _list_interfaces[ind].interfaceservicelist[ind1].ServiceinParameter.length(_length_in_param);
629 for (unsigned int ind2 = 0; ind2 < _length_in_param ; ind2 ++)
631 // duplicate parameter type
632 _list_interfaces[ind].interfaceservicelist[ind1].ServiceinParameter[ind2].Parametertype = CORBA::string_dup(list_interface[ind].Parserinterfaceservicelist[ind1].ParserServiceinParameter[ind2].ParserParamtype.c_str());
634 // duplicate parameter name
635 _list_interfaces[ind].interfaceservicelist[ind1].ServiceinParameter[ind2].Parametername = CORBA::string_dup(list_interface[ind].Parserinterfaceservicelist[ind1].ParserServiceinParameter[ind2].ParserParamname.c_str());
638 // duplicate out Parameters
639 unsigned int _length_out_param = list_interface[ind].Parserinterfaceservicelist[ind1].ParserServiceoutParameter.size();
640 _list_interfaces[ind].interfaceservicelist[ind1].ServiceoutParameter.length(_length_out_param);
641 for (unsigned int ind2 = 0; ind2 < _length_out_param ; ind2 ++)
643 // duplicate parameter type
644 _list_interfaces[ind].interfaceservicelist[ind1].ServiceoutParameter[ind2].Parametertype = CORBA::string_dup(list_interface[ind].Parserinterfaceservicelist[ind1].ParserServiceoutParameter[ind2].ParserParamtype.c_str());
646 // duplicate parameter name
647 _list_interfaces[ind].interfaceservicelist[ind1].ServiceoutParameter[ind2].Parametername = CORBA::string_dup(list_interface[ind].Parserinterfaceservicelist[ind1].ParserServiceoutParameter[ind2].ParserParamname.c_str());
652 return _list_interfaces;
656 //----------------------------------------------------------------------
657 // Function : duplicate_pathes
658 // Purpose : create the path prefix structures from the catalog parsing
659 //----------------------------------------------------------------------
661 SALOME_ModuleCatalogImpl::duplicate_pathes(ListOfParserPathPrefix pathes)
663 ListOfPathPrefix _pathes ;
665 unsigned int _length = pathes.size() ;
666 _pathes.resize(_length);
667 unsigned int _length_comput = 0;
669 for (unsigned int ind = 0; ind < _length ; ind++)
672 _pathes[ind].path = CORBA::string_dup(pathes[ind].path.c_str()) ;
673 //MESSAGE("Prefix : " << _pathes[ind].path);
675 _length_comput = pathes[ind].ListOfComputer.size() ;
676 _pathes[ind].ListOfComputer.resize(_length_comput);
677 for (unsigned int ind1 = 0; ind1 <_length_comput ; ind1++)
679 // duplicate computer name
680 _pathes[ind].ListOfComputer[ind1] = CORBA::string_dup(pathes[ind].ListOfComputer[ind1].c_str());
681 //MESSAGE("Computer associated to the prefix : " <<_pathes[ind].ListOfComputer[ind1]);
688 //----------------------------------------------------------------------
689 // Function : _verify_path_prefix
690 // Purpose : verify the path prefix structures from the catalog parsing
691 // Verify that there only one path prefix associated to a
692 // particular computer
693 //----------------------------------------------------------------------
695 SALOME_ModuleCatalogImpl::_verify_path_prefix(ListOfParserPathPrefix pathlist)
697 bool _return_value = true;
698 vector<string> _machine_list;
699 _machine_list.resize(0);
701 // Fill a list of all computers indicated in the path list
702 for (unsigned int ind = 0; ind < pathlist.size(); ind++)
704 for (unsigned int ind1 = 0 ; ind1 < pathlist[ind].ListOfComputer.size(); ind1++)
706 _machine_list.push_back(pathlist[ind].ListOfComputer[ind1]);
710 // Parse if a computer name is twice in the list of computers
711 for (unsigned int ind = 0; ind < _machine_list.size(); ind++)
713 for (unsigned int ind1 = ind+1 ; ind1 < _machine_list.size(); ind1++)
715 if(_machine_list[ind].compare(_machine_list[ind1]) == 0)
717 MESSAGE( "The computer " << _machine_list[ind] << " is indicated more than once in the path list")
718 _return_value = false;
722 return _return_value;
726 //----------------------------------------------------------------------
727 // Function : _parseArguments
728 // Purpose : parse arguments to get general and personal catalog files
729 //----------------------------------------------------------------------
731 SALOME_ModuleCatalogImpl::_parseArguments(int argc, char **argv,
735 bool _return_value = true;
738 for (int ind = 0; ind < argc ; ind++)
741 if (strcmp(argv[ind],"-help") == 0)
743 INFOS( "Usage: " << argv[0] << " -common 'path to general catalog' -personal 'path to personal catalog' -ORBInitRef NameService=corbaname::localhost");
744 _return_value = false ;
746 if (strcmp(argv[ind],"-common") == 0)
750 // General catalog file
751 *_general = argv[ind + 1] ;
752 /* ifstream _general_file(*_general);
755 MESSAGE( "Sorry the file " << *_general << " can't be open" )
757 _return_value = false;
762 else if (strcmp(argv[ind],"-personal") == 0)
766 // Personal catalog file
767 *_personal = argv[ind + 1] ;
768 /* ifstream _personal_file(*_personal);
771 MESSAGE("Sorry the file " << *_personal << " can't be open" )
773 _return_value = false;
779 return _return_value;