Salome HOME
0020523: String notebook support
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_IParameters.cxx
index 78d4ff8a198d0435c011e5966eced915663ea568..8e54d30bf7ed790b2014390393464d3ccbaa567b 100644 (file)
@@ -1,26 +1,27 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  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
 //
 #include "SALOMEDS_IParameters.hxx"
 #include <utilities.h>
 
-#include <TCollection_AsciiString.hxx>
-
 using namespace std;
 
 #define PT_INTEGER   0
@@ -199,22 +200,22 @@ vector<string> SALOMEDS_IParameters::getProperties()
 
 vector<string> SALOMEDS_IParameters::parseValue(const string& value, const char separator, bool fromEnd)
 {
-  TCollection_AsciiString val((char*)value.c_str());
+  string val(value);
   vector<string> v;
   int pos;
-  if(fromEnd) pos = val.SearchFromEnd(separator);
-  else pos = val.Search(separator);
+  if(fromEnd) pos = val.rfind(separator);
+  else pos = val.find(separator);
 
   if(pos < 0) {
     v.push_back(value);
     return v;
   }
 
-  TCollection_AsciiString part1, part2;
-  part1 = val.SubString(1, pos-1);
-  part2 = val.SubString(pos+1, val.Length());
-  v.push_back(part1.ToCString());
-  v.push_back(part2.ToCString());
+  string part1, part2;
+  part1 = val.substr(0, pos);
+  part2 = val.substr(pos+1, val.size());
+  v.push_back(part1);
+  v.push_back(part2);
   return v;
 }