1 // HOMARD HOMARD : implementation of HOMARD idl descriptions
3 // Copyright (C) 2011-2013 CEA/DEN, EDF R&D
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License.
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Lesser General Public License for more details.
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this library; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // Pilote l'ecriture du fichier xml pour lancer un schema YACS
28 #include "Utils_SALOME_Exception.hxx"
29 #include "utilities.h"
30 #include "YACSDriver.hxx"
32 //=============================================================================
33 //=============================================================================
34 YACSDriver::YACSDriver(const std::string YACSFile, const std::string DirName):
35 _YACSFile( "" ), _DirName( "" ),
37 _Texte_parametres( "" ),
38 _noeud_1( "CreateHypothesis" ),
41 MESSAGE("YACSFile = "<<YACSFile<<", DirName ="<<DirName);
45 //=============================================================================
46 //=============================================================================
47 YACSDriver::~YACSDriver()
50 //===============================================================================
51 // Ajout d'une ligne simple
52 //===============================================================================
53 void YACSDriver::TexteAdd( const std::string ligne )
55 // MESSAGE("TexteAdd, ligne ="<<ligne);
57 _Texte += ligne + "\n" ;
60 //===============================================================================
61 // Nom du fichier du maillage initial
62 //===============================================================================
63 void YACSDriver::Texte_DataInit_MeshFile( const std::string Meshfile )
65 MESSAGE("TexteInitMeshfile, Meshfile ="<<Meshfile);
67 _Texte += " <value><string>" ;
69 _Texte += "</string></value>\n" ;
72 //===============================================================================
73 // Le repertoire de calcul
74 // Le script de lancement
75 //===============================================================================
76 void YACSDriver::Texte_Alternance_Calcul_HOMARD_Calcul( const std::string FileName )
78 MESSAGE("Texte_Alternance_Calcul_HOMARD_Calcul, FileName : "<<FileName);
80 int position = FileName.find_last_of( '/' ) ;
81 std::string nomfic = FileName.substr( position+1 ) ;
82 position = nomfic.find_last_of( '.' ) ;;
83 nomfic = nomfic.substr( 0, position ) ;
84 MESSAGE("nomfic : "<<nomfic) ;
86 _Texte += "rep_calc = \"" + _DirName + "\"\n" ;
87 _Texte += "rep_script = os.path.dirname(\"" + FileName + "\")\n" ;
88 _Texte += "sys.path.append(rep_script)\n" ;
89 _Texte += "from " + nomfic + " import LanceCas\n" ;
92 //===============================================================================
94 //===============================================================================
95 void YACSDriver::Texte_HOMARD_Init_au_debut_Case_Options( const std::string pythonTexte )
97 MESSAGE("Texte_HOMARD_Init_au_debut_Case_Options, pythonTexte\n"<<pythonTexte);
99 _Texte += "DirName = \"" + _DirName + "/HOMARD\"\n" ;
100 _Texte += "Case.SetDirName(DirName)\n" ;
102 Texte_python( pythonTexte, 1, "Case" ) ;
105 //===============================================================================
106 // La description des zones
107 // ZoneType : le type de la zone
108 // pythonStructure : le python correspondant a la zone
109 // methode : methode associee a la creation de la zone
110 // ZoneName : nom de la zone
111 //===============================================================================
112 std::string YACSDriver::Texte_HOMARD_Init_au_debut_Zone( int ZoneType, const std::string pythonStructure, const std::string methode, const std::string ZoneName )
114 MESSAGE("Texte_HOMARD_Init_au_debut_Zone, ZoneType = "<<ZoneType<<", pythonStructure = "<<pythonStructure);
115 MESSAGE("methode = "<<methode<<", ZoneName = "<<ZoneName );
117 // 1. Le nom du noeud
118 std::string noeud_2 = methode + "_" + ZoneName ;
119 std::string node = "Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut." ;
121 // 2. Texte de controle
122 std::string texte_control = Texte_control (_noeud_1, noeud_2) ;
124 // 3. Definition du service
125 _Texte += " <service name=\"" + noeud_2 + "\">\n" ;
126 _Texte += " <node>Etude_Initialisation.SetCurrentStudy</node>\n" ;
127 _Texte += " <method>" + methode + "</method>\n" ;
129 // 4.1. Le nom de la zone
130 _Texte += Texte_inport( "string", "ZoneName" ) ;
131 TexteParametre( node, "ZoneName", "string", ZoneName ) ;
132 // 4.2. Les valeurs numeriques
133 // ATTENTION : les noms doivent etre les memes que dans Gen.xml, donc HOMARD_Gen.idl
134 // 4.2.1. Decodage des valeurs
135 // La chaine pythonStructure est de ce genre :
136 // CreateZoneBox( "Zone_1", 0.144, 0.216, 0.096, 0.1464, 0.076, 0.12)
137 std::string ligne = pythonStructure ;
138 // On commence par ne garder que ce qui suit la premiere virgule
139 ligne = GetStringInTexte( ligne, ",", 1 );
140 // On boucle pour isoler toutes les chaines dans les virgules
141 std::string lignebis ;
142 std::string x0, x1, x2, x3, x4, x5, x6, x7, x8 ;
144 while ( ligne != lignebis )
146 lignebis = GetStringInTexte ( ligne, ",", 0 ) ;
147 // MESSAGE("lignebis = "<<lignebis );
148 if ( iaux == 0 ) { x0 = lignebis ; }
149 else if ( iaux == 1 ) { x1 = lignebis ; }
150 else if ( iaux == 2 ) { x2 = lignebis ; }
151 else if ( iaux == 3 ) { x3 = lignebis ; }
152 else if ( iaux == 4 ) { x4 = lignebis ; }
153 else if ( iaux == 5 ) { x5 = lignebis ; }
154 else if ( iaux == 6 ) { x6 = lignebis ; }
155 else if ( iaux == 7 ) { x7 = lignebis ; }
156 ligne = GetStringInTexte( ligne, ",", 1 );
159 // La derniere valeur est toujours mise dans x8
160 x8 = GetStringInTexte ( ligne, ")", 0 ) ;
161 MESSAGE("coor = "<< x0<<","<<x1<< ","<< x2<< ","<< x3<<","<<x4<<","<<x5<<","<<x6<<","<<x7<<","<<x8);
162 // 4.2. Cas du parallelepipede (2)
165 _Texte += Texte_inport( "double", "Xmini" ) ;
166 _Texte += Texte_inport( "double", "Xmaxi" ) ;
167 _Texte += Texte_inport( "double", "Ymini" ) ;
168 _Texte += Texte_inport( "double", "Ymaxi" ) ;
169 _Texte += Texte_inport( "double", "Zmini" ) ;
170 _Texte += Texte_inport( "double", "Zmaxi" ) ;
171 TexteParametre( node, "Xmini", "double", x0 ) ;
172 TexteParametre( node, "Xmaxi", "double", x1 ) ;
173 TexteParametre( node, "Ymini", "double", x2 ) ;
174 TexteParametre( node, "Ymaxi", "double", x3 ) ;
175 TexteParametre( node, "Zmini", "double", x4 ) ;
176 TexteParametre( node, "Zmaxi", "double", x8 ) ;
179 // 4.2. Cas du rectangle (11, 12, 13)
180 else if ( ( ZoneType > 10 ) and ( ZoneType < 14 ) )
182 _Texte += Texte_inport( "double", "Umini" ) ;
183 _Texte += Texte_inport( "double", "Umaxi" ) ;
184 _Texte += Texte_inport( "double", "Vmini" ) ;
185 _Texte += Texte_inport( "double", "Vmaxi" ) ;
186 _Texte += Texte_inport( "long", "Orient" ) ;
187 TexteParametre( node, "Umini", "double", x0 ) ;
188 TexteParametre( node, "Umaxi", "double", x1 ) ;
189 TexteParametre( node, "Vmini", "double", x2 ) ;
190 TexteParametre( node, "Vmaxi", "double", x3 ) ;
191 TexteParametre( node, "Orient", "int", x8 ) ;
194 // 4.2. Cas du disque (31, 32, 33) ou du disque perce (61, 62, 63)
195 else if ( ( ( ZoneType > 30 ) and ( ZoneType < 34 ) ) or ( ( ZoneType > 60 ) and ( ZoneType < 64 ) ) )
197 _Texte += Texte_inport( "double", "Ucentre" ) ;
198 _Texte += Texte_inport( "double", "Vcentre" ) ;
199 _Texte += Texte_inport( "double", "Radius" ) ;
200 TexteParametre( node, "Ucentre", "double", x0 ) ;
201 TexteParametre( node, "Vcentre", "double", x1 ) ;
202 TexteParametre( node, "Radius", "double", x2 ) ;
205 _Texte += Texte_inport( "double", "InternalRadius" ) ;
206 TexteParametre( node, "InternalRadius", "double", x3 ) ;
208 _Texte += Texte_inport( "long", "Orient" ) ;
209 TexteParametre( node, "Orient", "int", x8 ) ;
212 // 4.2. Cas de la sphere (4)
213 else if ( ZoneType == 4 )
215 _Texte += Texte_inport( "double", "Xcentre" ) ;
216 _Texte += Texte_inport( "double", "Ycentre" ) ;
217 _Texte += Texte_inport( "double", "Zcentre" ) ;
218 _Texte += Texte_inport( "double", "Radius" ) ;
219 TexteParametre( node, "Xcentre", "double", x0 ) ;
220 TexteParametre( node, "Ycentre", "double", x1 ) ;
221 TexteParametre( node, "Zcentre", "double", x2 ) ;
222 TexteParametre( node, "Radius", "double", x8 ) ;
225 // 4.2. Cas du cylindre (5) ou du tuyau (7)
226 else if ( ZoneType == 5 or ZoneType == 7 )
228 _Texte += Texte_inport( "double", "Xcentre" ) ;
229 _Texte += Texte_inport( "double", "Ycentre" ) ;
230 _Texte += Texte_inport( "double", "Zcentre" ) ;
231 _Texte += Texte_inport( "double", "Xaxis" ) ;
232 _Texte += Texte_inport( "double", "Yaxis" ) ;
233 _Texte += Texte_inport( "double", "Zaxis" ) ;
234 _Texte += Texte_inport( "double", "Radius" ) ;
235 _Texte += Texte_inport( "double", "Height" ) ;
236 TexteParametre( node, "Xcentre", "double", x0 ) ;
237 TexteParametre( node, "Ycentre", "double", x1 ) ;
238 TexteParametre( node, "Zcentre", "double", x2 ) ;
239 TexteParametre( node, "Xaxis", "double", x3 ) ;
240 TexteParametre( node, "Yaxis", "double", x4 ) ;
241 TexteParametre( node, "Zaxis", "double", x5 ) ;
242 TexteParametre( node, "Radius", "double", x6 ) ;
245 TexteParametre( node, "Height", "double", x8 ) ;
249 _Texte += Texte_inport( "double", "InternalRadius" ) ;
250 TexteParametre( node, "Height", "double", x7 ) ;
251 TexteParametre( node, "InternalRadius", "double", x8 ) ;
257 { ASSERT("Type de zone inconnu." == 0); }
261 _Texte += " <outport name=\"return\" type=\"HOMARD_Zone\"/>\n" ;
262 _Texte += " </service>\n" ;
264 return texte_control ;
267 //===============================================================================
268 // La description des frontieres
269 // BoundaryType : le type de la frontiere
270 // pythonStructure : le python correspondant a la frontiere
271 // methode : methode associee a la creation de la frontiere
272 // BoundaryName : nom de la frontiere
273 //===============================================================================
274 std::string YACSDriver::Texte_HOMARD_Init_au_debut_Boundary( int BoundaryType, const std::string pythonStructure, const std::string methode, const std::string BoundaryName )
276 MESSAGE("Texte_HOMARD_Init_au_debut_Boundary, BoundaryType = "<<BoundaryType<<", pythonStructure = "<<pythonStructure);
277 MESSAGE("methode = "<<methode<<", BoundaryName = "<<BoundaryName );
279 // 1. Le nom du noeud
280 std::string noeud_2 = methode + "_" + BoundaryName ;
281 std::string node = "Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut." ;
283 // 2. Texte de controle
284 std::string texte_control = Texte_control (_noeud_1, noeud_2) ;
286 // 3. Definition du service
287 _Texte += " <service name=\"" + noeud_2 + "\">\n" ;
288 _Texte += " <node>Etude_Initialisation.SetCurrentStudy</node>\n" ;
289 _Texte += " <method>" + methode + "</method>\n" ;
291 // 4.1. Le nom de la zone
292 _Texte += Texte_inport( "string", "BoundaryName" ) ;
293 TexteParametre( node, "BoundaryName", "string", BoundaryName ) ;
294 // 4.2. Les valeurs numeriques
295 // ATTENTION : les noms doivent etre les memes que dans Gen.xml, donc HOMARD_Gen.idl
296 // 4.2.1. Decodage des valeurs
297 // La chaine pythonStructure est de ce genre :
298 // CreateBoundaryCylinder('cyl_2', 17.5, -2.5, -12.5, -100., -75., -25., 50.)
299 // CreateBoundaryDi("intersection", "PIQUAGE", "/scratch/D68518/Salome/script/sfr_2d_piquage.fr.med")
300 std::string ligne = pythonStructure ;
301 // On commence par ne garder que ce qui suit la premiere virgule
302 ligne = GetStringInTexte( ligne, ",", 1 );
303 // On boucle pour isoler toutes les chaines dans les virgules
304 std::string lignebis ;
305 std::string x0, x1, x2, x3, x4, x5, x6, x7 ;
307 while ( ligne != lignebis )
309 lignebis = GetStringInTexte ( ligne, ",", 0 ) ;
310 // MESSAGE("lignebis = "<<lignebis );
311 if ( iaux == 0 ) { x0 = lignebis ; }
312 else if ( iaux == 1 ) { x1 = lignebis ; }
313 else if ( iaux == 2 ) { x2 = lignebis ; }
314 else if ( iaux == 3 ) { x3 = lignebis ; }
315 else if ( iaux == 4 ) { x4 = lignebis ; }
316 else if ( iaux == 5 ) { x5 = lignebis ; }
317 else if ( iaux == 6 ) { x6 = lignebis ; }
318 ligne = GetStringInTexte( ligne, ",", 1 );
321 // La derniere valeur est toujours mise dans x7
322 x7 = GetStringInTexte ( ligne, ")", 0 ) ;
323 MESSAGE("coor = "<< x0<<","<<x1<< ","<< x2<< ","<< x3<<","<<x4<<","<<x5<<","<<x6<<",x7"<<x7);
325 // 4.2. Cas d une frontiere discrete (0)
326 if (BoundaryType == 0) // Cas d une frontiere discrete
328 _Texte += Texte_inport( "string", "MeshName" ) ;
329 TexteParametre( node, "MeshName", "string", BoundaryName ) ;
330 _Texte += Texte_inport( "string", "FileName" ) ;
331 TexteParametre( node, "FileName", "string", BoundaryName ) ;
333 // 4.2. Cas du cylindre (1)
334 else if ( BoundaryType == 1 )
336 _Texte += Texte_inport( "double", "Xcentre" ) ;
337 _Texte += Texte_inport( "double", "Ycentre" ) ;
338 _Texte += Texte_inport( "double", "Zcentre" ) ;
339 _Texte += Texte_inport( "double", "Xaxis" ) ;
340 _Texte += Texte_inport( "double", "Yaxis" ) ;
341 _Texte += Texte_inport( "double", "Zaxis" ) ;
342 _Texte += Texte_inport( "double", "Radius" ) ;
343 TexteParametre( node, "Xcentre", "double", x0 ) ;
344 TexteParametre( node, "Ycentre", "double", x1 ) ;
345 TexteParametre( node, "Zcentre", "double", x2 ) ;
346 TexteParametre( node, "Xaxis", "double", x3 ) ;
347 TexteParametre( node, "Yaxis", "double", x4 ) ;
348 TexteParametre( node, "Zaxis", "double", x5 ) ;
349 TexteParametre( node, "Radius", "double", x7 ) ;
352 // 4.2. Cas de la sphere (2)
353 else if ( BoundaryType == 2 )
355 _Texte += Texte_inport( "double", "Xcentre" ) ;
356 _Texte += Texte_inport( "double", "Ycentre" ) ;
357 _Texte += Texte_inport( "double", "Zcentre" ) ;
358 _Texte += Texte_inport( "double", "Radius" ) ;
359 TexteParametre( node, "Xcentre", "double", x0 ) ;
360 TexteParametre( node, "Ycentre", "double", x1 ) ;
361 TexteParametre( node, "Zcentre", "double", x2 ) ;
362 TexteParametre( node, "Radius", "double", x7 ) ;
365 // 4.2. Cas d un cone defini par un axe et un angle
366 else if ( BoundaryType == 3 )
368 _Texte += Texte_inport( "double", "Xaxis" ) ;
369 _Texte += Texte_inport( "double", "Yaxis" ) ;
370 _Texte += Texte_inport( "double", "Zaxis" ) ;
371 _Texte += Texte_inport( "double", "Angle" ) ;
372 _Texte += Texte_inport( "double", "Xcentre" ) ;
373 _Texte += Texte_inport( "double", "Ycentre" ) ;
374 _Texte += Texte_inport( "double", "Zcentre" ) ;
375 TexteParametre( node, "Xaxis", "double", x0 ) ;
376 TexteParametre( node, "Yaxis", "double", x1 ) ;
377 TexteParametre( node, "Zaxis", "double", x2 ) ;
378 TexteParametre( node, "Angle", "double", x3 ) ;
379 TexteParametre( node, "Xcentre", "double", x4 ) ;
380 TexteParametre( node, "Ycentre", "double", x5 ) ;
381 TexteParametre( node, "Zcentre", "double", x7 ) ;
384 // 4.2. Cas d un cone defini par les 2 rayons
385 else if ( BoundaryType == 4 )
387 _Texte += Texte_inport( "double", "Xcentre1" ) ;
388 _Texte += Texte_inport( "double", "Ycentre1" ) ;
389 _Texte += Texte_inport( "double", "Zcentre1" ) ;
390 _Texte += Texte_inport( "double", "Radius1" ) ;
391 _Texte += Texte_inport( "double", "Xcentre2" ) ;
392 _Texte += Texte_inport( "double", "Ycentre2" ) ;
393 _Texte += Texte_inport( "double", "Zcentre2" ) ;
394 _Texte += Texte_inport( "double", "Radius2" ) ;
395 TexteParametre( node, "Xcentre1", "double", x0 ) ;
396 TexteParametre( node, "Ycentre1", "double", x1 ) ;
397 TexteParametre( node, "Zcentre1", "double", x2 ) ;
398 TexteParametre( node, "Radius1", "double", x3 ) ;
399 TexteParametre( node, "Xcentre2", "double", x4 ) ;
400 TexteParametre( node, "Ycentre2", "double", x5 ) ;
401 TexteParametre( node, "Zcentre2", "double", x6 ) ;
402 TexteParametre( node, "Radius2", "double", x7 ) ;
407 { ASSERT("Type de frontiere inconnu." == 0); }
411 _Texte += " <outport name=\"return\" type=\"HOMARD_Boundary\"/>\n" ;
412 _Texte += " </service>\n" ;
414 return texte_control ;
417 //===============================================================================
418 // Controle des enchainements de noeud dans le noeud HOMARD_Init_au_debut
419 //===============================================================================
420 std::string YACSDriver::Texte_HOMARD_Init_au_debut_control()
422 MESSAGE("Texte_HOMARD_Init_au_debut_control");
425 texte = Texte_control ("CreateCase", "Case_Options") ;
426 texte += Texte_control ("Case_Options", "CreateHypothesis") ;
431 //===============================================================================
432 // Controle des enchainements de noeuds
433 // noeud_1 : noeud de depart
434 // noeud_2 : noeud d'arrivee
435 //===============================================================================
436 std::string YACSDriver::Texte_control( const std::string noeud_1, const std::string noeud_2 )
438 MESSAGE("Texte_control, noeud_1 = "<<noeud_1<<", noeud_2 = "<<noeud_2);
441 texte = " <control> " ;
442 texte += "<fromnode>" + noeud_1 + "</fromnode>" ;
443 texte += " <tonode>" + noeud_2 + "</tonode>" ;
444 texte += " </control>\n" ;
449 //===============================================================================
451 // inport_type : type de la donnee a importer
452 // inport_nom : nom de la donnee a importer
453 //===============================================================================
454 std::string YACSDriver::Texte_inport( const std::string inport_type, const std::string inport_nom )
456 // MESSAGE("Texte_control, inport_type = "<<inport_type<<", inport_nom = "<<inport_nom);
459 texte = " <inport " ;
460 texte += "name=\"" + inport_nom + "\" " ;
461 texte += "type=\"" + inport_type + "\"" ;
467 //===============================================================================
468 // Le repertoire d'execution
469 //===============================================================================
470 void YACSDriver::Texte_HOMARD_Exec_DirName( )
472 MESSAGE("Texte_HOMARD_Exec_DirName");
474 _Texte += "DirName = \"" + _DirName + "\"\n" ;
477 //===============================================================================
478 // Manipulation des instructions python
479 // pythonTexte : le texte des instructions python a manipuler
480 // indice : numero de la premiere ligne voulue
481 // concept : nom du concept a inserer
482 //===============================================================================
483 void YACSDriver::Texte_python( const std::string pythonTexte, int indice, const std::string concept )
485 MESSAGE("Texte_python, pythonTexte\n"<<pythonTexte);
486 MESSAGE("indice = "<<indice<<", concept = "<<concept);
488 // Conversion de type
489 std::istringstream tout (pythonTexte) ;
490 // MESSAGE("\ntout :"<<tout);
491 std::string ligne; // variable contenant chaque ligne de python
492 std::string ligne_bis ; // variable contenant la portion de ligne de python apres '.'
495 while ( std::getline( tout, ligne ) )
499 int position = ligne.find_first_of( "." ) ;
500 // MESSAGE("\nposition : "<< position);
503 ligne_bis = ligne.substr( position );
504 // MESSAGE("\nligne_bis : "<< ligne_bis);
505 _Texte += concept + ligne_bis + "\n" ;
512 //===============================================================================
513 // Creation d'un parametre
514 //===============================================================================
515 void YACSDriver::TexteParametre( const std::string node, const std::string port, const std::string type_value, const std::string value )
518 // MESSAGE("TexteParametre");
519 _Texte_parametres += " <parameter>\n" ;
520 _Texte_parametres += " <tonode>" + node + "</tonode>" ;
521 _Texte_parametres += "<toport>" + port + "</toport>\n" ;
522 _Texte_parametres += " <value><" + type_value + ">" + value + "</" + type_value + "></value>\n" ;
523 _Texte_parametres += " </parameter>\n" ;
526 //===============================================================================
527 // Ajout des parametres
528 //===============================================================================
529 void YACSDriver::TexteAddParametres( )
532 MESSAGE("TexteAddParametres");
533 TexteAdd(_Texte_parametres) ;
536 //===============================================================================
537 void YACSDriver::CreeFichier( )
540 MESSAGE("CreeFichier sur le fichier "<<_YACSFile);
541 std::ofstream Fic(_YACSFile.c_str(), std::ios::out ) ;
542 if (Fic.is_open() == true) { Fic << _Texte << std::endl ; }
546 //===============================================================================
547 // REMARQUE : on devrait utiliser le GetStringInTexte de HOMARD_Gen_i mais je ne sais pas
548 // comment l'appeler. ALors je clone.
549 // Recuperation de la chaine de caracteres par rapport l'apparition d'un texte
550 // ligne : la ligne a manipuler
551 // texte : le texte a reperer
552 // option : 0 : la chaine avant le texte
553 // 1 : la chaine apres le texte
554 // Si le texte est absent, on retourne la chaine totale
555 //===============================================================================
556 std::string YACSDriver::GetStringInTexte( const std::string ligne, const std::string texte, int option )
558 // MESSAGE("GetStringInTexte, recherche de '"<<texte<<"' dans '"<<ligne<<"'"<<", option = "<<option);
560 std::string chaine = ligne ;
561 int position = ligne.find_first_of( texte ) ;
564 if ( option == 0 ) { chaine = ligne.substr( 0, position ) ; }
565 else { chaine = ligne.substr( position+1 ) ; }
567 // Conversion de type