Salome HOME
add method NameChanged to update title name
[modules/kernel.git] / src / SALOMEDSImpl / SALOMEDSImpl_AttributeParameter.cxx
index 1eea12dbd4f1ecb6812b2310ec9c4236ca74578e..b2e10d93fcecb86121b3d9e9187468fb7e55e5c7 100644 (file)
@@ -1,45 +1,40 @@
-// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// 
+//
 // 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 
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// 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 
+// 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
 //
+
 //  File   : SALOMEDSImpl_AttributeParameter.cxx
 //  Author : Sergey RUIN
 //  Module : SALOME
-
-
+//
 #include "SALOMEDSImpl_AttributeParameter.hxx"
-#include <Standard_Failure.hxx>
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <strstream>
-
-using namespace std;
-
-
-
-IMPLEMENT_STANDARD_HANDLE( SALOMEDSImpl_AttributeParameter, SALOMEDSImpl_GenericAttribute )
-IMPLEMENT_STANDARD_RTTIEXT( SALOMEDSImpl_AttributeParameter, SALOMEDSImpl_GenericAttribute )
+#include <sstream>
+#include <sstream>
 
 
 // Purpose: Each character in the string is replaced by 3 characters: '%' and hex number 
 //          of the character (2 characters)
-string convertString(const string& S)
+std::string convertString(const std::string& S)
 {
   int length = S.size();
   const char *s = S.c_str();
@@ -48,19 +43,19 @@ string convertString(const string& S)
   for(int i = 0, pos = 0; i<length; i++, pos+=3) {
     int val = (int)s[i];
     buffer[pos] = '%';
-    sprintf(c, "%x", val);
+    sprintf(c, "%.2x", val);
     buffer[pos+1] = c[0]; 
     buffer[pos+2] = c[1];
   }
 
-  string RS(buffer); 
-  delete c;
-  delete buffer;
+  std::string RS(buffer); 
+  delete [] c;
+  delete [] buffer;
   return RS;
 }
 
 //Restors a string converted by the function convertString
-string restoreString(const string& S)
+std::string restoreString(const std::string& S)
 {
   int length = S.size();
   char *c = new char[3], *buffer = new char[length/3+1];
@@ -74,9 +69,9 @@ string restoreString(const string& S)
     buffer[pos] = (char)val;
   }
 
-  string RS(buffer); 
-  delete c;
-  delete buffer;
+  std::string RS(buffer); 
+  delete [] c;
+  delete [] buffer;
   return RS;
 }
 
@@ -86,9 +81,9 @@ string restoreString(const string& S)
  * Purpose  : Returns GUID of the attribute
  */
 //=======================================================================
-const Standard_GUID& SALOMEDSImpl_AttributeParameter::GetID ()
+const std::string& SALOMEDSImpl_AttributeParameter::GetID ()
 {
-  static Standard_GUID ParemeterID ("BA75F3A1-E40B-46b8-8D24-B1D3C3BB1A8C");
+  static std::string ParemeterID ("BA75F3A1-E40B-46b8-8D24-B1D3C3BB1A8C");
   return ParemeterID;
 }   
 
@@ -98,10 +93,10 @@ const Standard_GUID& SALOMEDSImpl_AttributeParameter::GetID ()
  * Purpose  : Adds an attribute to the label
  */
 //=======================================================================
-Handle(SALOMEDSImpl_AttributeParameter) SALOMEDSImpl_AttributeParameter::Set (const TDF_Label& L) 
+SALOMEDSImpl_AttributeParameter* SALOMEDSImpl_AttributeParameter::Set (const DF_Label& L) 
 {
-  Handle(SALOMEDSImpl_AttributeParameter) A;
-  if (!L.FindAttribute(SALOMEDSImpl_AttributeParameter::GetID(), A)) {
+  SALOMEDSImpl_AttributeParameter* A = NULL;
+  if (!(A=(SALOMEDSImpl_AttributeParameter*)L.FindAttribute(SALOMEDSImpl_AttributeParameter::GetID()))) {
     A = new  SALOMEDSImpl_AttributeParameter(); 
     L.AddAttribute(A);
   }
@@ -115,10 +110,12 @@ Handle(SALOMEDSImpl_AttributeParameter) SALOMEDSImpl_AttributeParameter::Set (co
  * Purpose  : Associates a integer value with the ID
  */
 //=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetInt(const string& theID, const int& theValue)
+void SALOMEDSImpl_AttributeParameter::SetInt(const std::string& theID, const int& theValue)
 {
   CheckLocked();
 
+  if(theID.size() == 0) return;
+
   Backup();
 
   _ints[theID] = theValue;
@@ -132,9 +129,9 @@ void SALOMEDSImpl_AttributeParameter::SetInt(const string& theID, const int& the
  * Purpose  : Returns a int value associated with the given ID
  */
 //=======================================================================
-int SALOMEDSImpl_AttributeParameter::GetInt(const string& theID)
+int SALOMEDSImpl_AttributeParameter::GetInt(const std::string& theID)
 {
-  if(!IsSet(theID, PT_INTEGER)) Standard_Failure::Raise("Invalid ID");
+  if(!IsSet(theID, PT_INTEGER)) throw DFexception("Invalid ID");
   return _ints[theID];
 }
 
@@ -144,10 +141,12 @@ int SALOMEDSImpl_AttributeParameter::GetInt(const string& theID)
  * Purpose  : Associates a double value with the ID
  */
 //=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetReal(const string& theID, const double& theValue)
+void SALOMEDSImpl_AttributeParameter::SetReal(const std::string& theID, const double& theValue)
 {
   CheckLocked();
 
+  if(theID.size() == 0) return;
+
   Backup();
 
   _reals[theID] = theValue;
@@ -161,9 +160,9 @@ void SALOMEDSImpl_AttributeParameter::SetReal(const string& theID, const double&
  * Purpose  : Returns a double value associated with the given ID
  */
 //=======================================================================
-double SALOMEDSImpl_AttributeParameter::GetReal(const string& theID)
+double SALOMEDSImpl_AttributeParameter::GetReal(const std::string& theID)
 {
-  if(!IsSet(theID, PT_REAL)) Standard_Failure::Raise("Invalid ID");
+  if(!IsSet(theID, PT_REAL)) throw DFexception("Invalid ID");
   return _reals[theID];
 }
 
@@ -173,10 +172,12 @@ double SALOMEDSImpl_AttributeParameter::GetReal(const string& theID)
  * Purpose  : Associates a string with the ID
  */
 //=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetString(const string& theID, const string& theValue)
+void SALOMEDSImpl_AttributeParameter::SetString(const std::string& theID, const std::string& theValue)
 {
   CheckLocked();
 
+  if(theID.size() == 0) return;
+
   Backup();
 
   _strings[theID] = theValue;
@@ -190,9 +191,9 @@ void SALOMEDSImpl_AttributeParameter::SetString(const string& theID, const strin
  * Purpose  : Returns a string associated with the given ID
  */
 //=======================================================================
-string SALOMEDSImpl_AttributeParameter::GetString(const string& theID)
+std::string SALOMEDSImpl_AttributeParameter::GetString(const std::string& theID)
 {
-  if(!IsSet(theID, PT_STRING)) Standard_Failure::Raise("Invalid ID");
+  if(!IsSet(theID, PT_STRING)) throw DFexception("Invalid ID");
   return _strings[theID];
 }
 
@@ -202,10 +203,12 @@ string SALOMEDSImpl_AttributeParameter::GetString(const string& theID)
  * Purpose  : Associates a bool value with the ID
  */
 //=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetBool(const string& theID, const bool& theValue)
+void SALOMEDSImpl_AttributeParameter::SetBool(const std::string& theID, const bool& theValue)
 {
   CheckLocked();
 
+  if(theID.size() == 0) return;
+
   Backup();
 
   _bools[theID] = theValue;
@@ -219,9 +222,9 @@ void SALOMEDSImpl_AttributeParameter::SetBool(const string& theID, const bool& t
  * Purpose  : Returns a bool value associated with the ID
  */
 //=======================================================================
-bool SALOMEDSImpl_AttributeParameter::GetBool(const string& theID)
+bool SALOMEDSImpl_AttributeParameter::GetBool(const std::string& theID)
 {
-  if(!IsSet(theID, PT_BOOLEAN)) Standard_Failure::Raise("Invalid ID");
+  if(!IsSet(theID, PT_BOOLEAN)) throw DFexception("Invalid ID");
   return _bools[theID];
 }
 
@@ -231,10 +234,12 @@ bool SALOMEDSImpl_AttributeParameter::GetBool(const string& theID)
  * Purpose  : Associates an array of double values with the given ID
  */
 //=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetRealArray(const string& theID, const vector<double>& theArray)
+void SALOMEDSImpl_AttributeParameter::SetRealArray(const std::string& theID, const std::vector<double>& theArray)
 {
   CheckLocked();
 
+  if(theID.size() == 0) return;
+
   Backup();
 
   _realarrays[theID] = theArray;
@@ -248,9 +253,9 @@ void SALOMEDSImpl_AttributeParameter::SetRealArray(const string& theID, const ve
  * Purpose  : Returns double values associated with the ID
  */
 //=======================================================================
-vector<double> SALOMEDSImpl_AttributeParameter::GetRealArray(const string& theID)
+std::vector<double> SALOMEDSImpl_AttributeParameter::GetRealArray(const std::string& theID)
 {
-  if(!IsSet(theID, PT_REALARRAY)) Standard_Failure::Raise("Invalid ID");
+  if(!IsSet(theID, PT_REALARRAY)) throw DFexception("Invalid ID");
   return _realarrays[theID];
 }
  
@@ -261,10 +266,12 @@ vector<double> SALOMEDSImpl_AttributeParameter::GetRealArray(const string& theID
  * Purpose  : Associates an array of int values with the given ID
  */
 //=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetIntArray(const string& theID, const vector<int>& theArray)
+void SALOMEDSImpl_AttributeParameter::SetIntArray(const std::string& theID, const std::vector<int>& theArray)
 {
   CheckLocked();
 
+  if(theID.size() == 0) return;
+
   Backup();
 
   _intarrays[theID] = theArray;
@@ -278,9 +285,9 @@ void SALOMEDSImpl_AttributeParameter::SetIntArray(const string& theID, const vec
  * Purpose  : Returns int values associated with the ID
  */
 //=======================================================================
-vector<int> SALOMEDSImpl_AttributeParameter::GetIntArray(const string& theID)
+std::vector<int> SALOMEDSImpl_AttributeParameter::GetIntArray(const std::string& theID)
 {
-  if(!IsSet(theID, PT_INTARRAY)) Standard_Failure::Raise("Invalid ID");
+  if(!IsSet(theID, PT_INTARRAY)) throw DFexception("Invalid ID");
   return _intarrays[theID];
 }
  
@@ -291,10 +298,12 @@ vector<int> SALOMEDSImpl_AttributeParameter::GetIntArray(const string& theID)
  * Purpose  : Associates an array of string values with the given ID
  */
 //=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetStrArray(const string& theID, const vector<string>& theArray)
+void SALOMEDSImpl_AttributeParameter::SetStrArray(const std::string& theID, const std::vector<std::string>& theArray)
 {
   CheckLocked();
 
+  if(theID.size() == 0) return;
+
   Backup();
 
   _strarrays[theID] = theArray;
@@ -308,9 +317,9 @@ void SALOMEDSImpl_AttributeParameter::SetStrArray(const string& theID, const vec
  * Purpose  : Returns string values associated with the ID
  */
 //=======================================================================
-vector<string> SALOMEDSImpl_AttributeParameter::GetStrArray(const string& theID)
+std::vector<std::string> SALOMEDSImpl_AttributeParameter::GetStrArray(const std::string& theID)
 {
-  if(!IsSet(theID, PT_STRARRAY)) Standard_Failure::Raise("Invalid ID");
+  if(!IsSet(theID, PT_STRARRAY)) throw DFexception("Invalid ID");
   return _strarrays[theID];
 }
  
@@ -322,7 +331,7 @@ vector<string> SALOMEDSImpl_AttributeParameter::GetStrArray(const string& theID)
  *            a value in the attribute
  */
 //=======================================================================
-bool SALOMEDSImpl_AttributeParameter::IsSet(const string& theID, const Parameter_Types theType)
+bool SALOMEDSImpl_AttributeParameter::IsSet(const std::string& theID, const Parameter_Types theType)
 {
   switch(theType) {
   case PT_INTEGER: {
@@ -365,7 +374,7 @@ bool SALOMEDSImpl_AttributeParameter::IsSet(const string& theID, const Parameter
  * Purpose  : Removes a parameter with given ID
  */
 //=======================================================================
-bool SALOMEDSImpl_AttributeParameter::RemoveID(const string& theID, const Parameter_Types theType)
+bool SALOMEDSImpl_AttributeParameter::RemoveID(const std::string& theID, const Parameter_Types theType)
 {
   Backup();
   SetModifyFlag(); 
@@ -413,15 +422,15 @@ bool SALOMEDSImpl_AttributeParameter::RemoveID(const string& theID, const Parame
  * Purpose  : Returns a father attribute for this attribute
  */
 //=======================================================================
-Handle(SALOMEDSImpl_AttributeParameter) SALOMEDSImpl_AttributeParameter::GetFather()
+SALOMEDSImpl_AttributeParameter* SALOMEDSImpl_AttributeParameter::GetFather()
 {
-  Handle(SALOMEDSImpl_AttributeParameter) aFather;
-  TDF_Label L = Label();
+  SALOMEDSImpl_AttributeParameter* aFather;
+  DF_Label L = Label();
   if(L.IsRoot()) return aFather;
 
   while(!L.IsRoot()) {
     L = L.Father();
-    if(L.FindAttribute(SALOMEDSImpl_AttributeParameter::GetID(), aFather)) break; 
+    if((aFather=(SALOMEDSImpl_AttributeParameter*)L.FindAttribute(SALOMEDSImpl_AttributeParameter::GetID()))) break; 
   }
 
   return aFather;
@@ -435,7 +444,7 @@ Handle(SALOMEDSImpl_AttributeParameter) SALOMEDSImpl_AttributeParameter::GetFath
 //=======================================================================
 bool SALOMEDSImpl_AttributeParameter::HasFather()
 {
-  TDF_Label L = Label();
+  DF_Label L = Label();
   if(L.IsRoot()) return false;
   while(!L.IsRoot()) {
     L = L.Father();
@@ -483,66 +492,66 @@ void SALOMEDSImpl_AttributeParameter::Clear()
  * Purpose  : Returns an array of all ID's of the given type
  */
 //=======================================================================
-vector<string> SALOMEDSImpl_AttributeParameter::GetIDs(const Parameter_Types theType)
+std::vector<std::string> SALOMEDSImpl_AttributeParameter::GetIDs(const Parameter_Types theType)
 {
   
-  vector<string> anArray;
+  std::vector<std::string> anArray;
   int i = 0;
 
   switch(theType) {
   case PT_INTEGER: {
     if(_ints.size()) {
       anArray.resize(_ints.size());
-      for(map<string,int>::const_iterator p = _ints.begin(); p != _ints.end(); p++, i++) 
-       anArray[i] =  p->first;
+      for(std::map<std::string,int>::const_iterator p = _ints.begin(); p != _ints.end(); p++, i++) 
+        anArray[i] =  p->first;
     }
     break;
   }
   case PT_REAL: {
     if(_reals.size()) {
       anArray.resize(_reals.size());
-      for(map<string,double>::const_iterator p = _reals.begin(); p != _reals.end(); p++, i++) 
-       anArray[i] = p->first;
+      for(std::map<std::string,double>::const_iterator p = _reals.begin(); p != _reals.end(); p++, i++) 
+        anArray[i] = p->first;
     }
     break;
   }
   case PT_BOOLEAN: {
     if(_bools.size()) {
       anArray.resize(_bools.size());
-      for(map<string,bool>::const_iterator p = _bools.begin(); p != _bools.end(); p++, i++) 
-       anArray[i] = p->first;
+      for(std::map<std::string,bool>::const_iterator p = _bools.begin(); p != _bools.end(); p++, i++) 
+        anArray[i] = p->first;
     }
     break;
   }
   case PT_STRING: {
     if(_strings.size()) {
       anArray.resize(_strings.size());
-      for(map<string,string>::const_iterator p = _strings.begin(); p!= _strings.end(); p++) 
-       anArray[i] = p->first;
+      for(std::map<std::string,std::string>::const_iterator p = _strings.begin(); p!= _strings.end(); p++) 
+        anArray[i] = p->first;
     }
     break;
   }
   case PT_REALARRAY: {
     if(_realarrays.size()) {
       anArray.resize(_realarrays.size());
-      for(map< string, vector<double> >::const_iterator p = _realarrays.begin(); p!= _realarrays.end(); p++) 
-       anArray[i] = p->first;
+      for(std::map< std::string, std::vector<double> >::const_iterator p = _realarrays.begin(); p!= _realarrays.end(); p++) 
+        anArray[i] = p->first;
     }
     break;
   }
   case PT_INTARRAY: {
     if(_intarrays.size()) {
       anArray.resize(_intarrays.size());
-      for(map< string, vector<int> >::const_iterator p = _intarrays.begin(); p!= _intarrays.end(); p++) 
-       anArray[i] = p->first;
+      for(std::map< std::string, std::vector<int> >::const_iterator p = _intarrays.begin(); p!= _intarrays.end(); p++) 
+        anArray[i] = p->first;
     }
     break;
   }
   case PT_STRARRAY: {
     if(_strarrays.size()) {
       anArray.resize(_strarrays.size());
-      for(map< string, vector<string> >::const_iterator p = _strarrays.begin(); p!= _strarrays.end(); p++) 
-       anArray[i] = p->first;
+      for(std::map< std::string, std::vector<std::string> >::const_iterator p = _strarrays.begin(); p!= _strarrays.end(); p++) 
+        anArray[i] = p->first;
     }
     break;
   }
@@ -558,10 +567,10 @@ vector<string> SALOMEDSImpl_AttributeParameter::GetIDs(const Parameter_Types the
  * Purpose  : Rteurns an GUID of the attribute
  */
 //=======================================================================
-const Standard_GUID& SALOMEDSImpl_AttributeParameter::ID () const { return GetID(); } 
+const std::string& SALOMEDSImpl_AttributeParameter::ID () const { return GetID(); } 
 
 
-Handle(TDF_Attribute) SALOMEDSImpl_AttributeParameter::NewEmpty () const
+DF_Attribute* SALOMEDSImpl_AttributeParameter::NewEmpty () const
 {  
   return new SALOMEDSImpl_AttributeParameter(); 
 }
@@ -572,9 +581,9 @@ Handle(TDF_Attribute) SALOMEDSImpl_AttributeParameter::NewEmpty () const
  * Purpose  : Restors the content of the attribute from another
  */
 //=======================================================================
-void SALOMEDSImpl_AttributeParameter::Restore(const Handle(TDF_Attribute)& with) 
+void SALOMEDSImpl_AttributeParameter::Restore(DF_Attribute* with) 
 {
-  Handle(SALOMEDSImpl_AttributeParameter) A = Handle(SALOMEDSImpl_AttributeParameter)::DownCast (with);
+  SALOMEDSImpl_AttributeParameter* A = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(with);
   _ints.clear();
   _reals.clear();
   _bools.clear();
@@ -583,17 +592,20 @@ void SALOMEDSImpl_AttributeParameter::Restore(const Handle(TDF_Attribute)& with)
   _intarrays.clear();
   _strarrays.clear();
   
-  for(map<string,int>::const_iterator p = A->_ints.begin(); p!= A->_ints.end(); p++) _ints[p->first] = p->second;
-  for(map<string,double>::const_iterator p = A->_reals.begin(); p!= A->_reals.end(); p++) _reals[p->first] = p->second;
-  for(map<string,bool>::const_iterator p = A->_bools.begin(); p!= A->_bools.end(); p++) _bools[p->first] = p->second;
-  for(map<string,string>::const_iterator p = A->_strings.begin(); p!= A->_strings.end(); p++) 
-    _strings[p->first] = p->second;
-  for(map< string,vector<double> >::const_iterator p = A->_realarrays.begin(); p!= A->_realarrays.end(); p++) 
-    _realarrays[p->first] = p->second;  
-  for(map< string,vector<int> >::const_iterator p = A->_intarrays.begin(); p!= A->_intarrays.end(); p++) 
-    _intarrays[p->first] = p->second;  
-  for(map< string,vector<string> >::const_iterator p = A->_strarrays.begin(); p!= A->_strarrays.end(); p++) 
-    _strarrays[p->first] = p->second; 
+  for(std::map<std::string,int>::const_iterator p = A->_ints.begin(); p!= A->_ints.end(); p++)
+    if(p->first.size()) _ints[p->first] = p->second;
+  for(std::map<std::string,double>::const_iterator p = A->_reals.begin(); p!= A->_reals.end(); p++) 
+    if(p->first.size()) _reals[p->first] = p->second;
+  for(std::map<std::string,bool>::const_iterator p = A->_bools.begin(); p!= A->_bools.end(); p++) 
+    if(p->first.size()) _bools[p->first] = p->second;
+  for(std::map<std::string,std::string>::const_iterator p = A->_strings.begin(); p!= A->_strings.end(); p++) 
+    if(p->first.size()) _strings[p->first] = p->second;
+  for(std::map< std::string,std::vector<double> >::const_iterator p = A->_realarrays.begin(); p!= A->_realarrays.end(); p++) 
+    if(p->first.size()) _realarrays[p->first] = p->second;  
+  for(std::map< std::string,std::vector<int> >::const_iterator p = A->_intarrays.begin(); p!= A->_intarrays.end(); p++) 
+    if(p->first.size()) _intarrays[p->first] = p->second;  
+  for(std::map< std::string,std::vector<std::string> >::const_iterator p = A->_strarrays.begin(); p!= A->_strarrays.end(); p++) 
+    if(p->first.size()) _strarrays[p->first] = p->second; 
 }
 
 //=======================================================================
@@ -602,8 +614,7 @@ void SALOMEDSImpl_AttributeParameter::Restore(const Handle(TDF_Attribute)& with)
  * Purpose  : Pastes the content of attribute to another
  */
 //=======================================================================
-void SALOMEDSImpl_AttributeParameter::Paste (const Handle(TDF_Attribute)& into,
-                                            const Handle(TDF_RelocationTable)& RT) const
+void SALOMEDSImpl_AttributeParameter::Paste (DF_Attribute* into)
 {
   into->Restore(this);
 }
@@ -614,36 +625,36 @@ void SALOMEDSImpl_AttributeParameter::Paste (const Handle(TDF_Attribute)& into,
  * Purpose  : Saves a content of the attribute as a string
  */
 //=======================================================================
-TCollection_AsciiString SALOMEDSImpl_AttributeParameter::Save() 
+std::string SALOMEDSImpl_AttributeParameter::Save() 
 { 
-  ostrstream buffer;
+  std::ostringstream buffer;
   char *tmpBuffer = new char[255];
 
   buffer << _ints.size() << " ";
 
-  for(map<string,int>::const_iterator p = _ints.begin(); p != _ints.end(); p++) {
+  for(std::map<std::string,int>::const_iterator p = _ints.begin(); p != _ints.end(); p++) {
     buffer << convertString(p->first) << " " << p->second << " ";
   }
 
   buffer << _reals.size() << " ";
-  for(map<string,double>::const_iterator p =_reals.begin(); p != _reals.end(); p++) {
+  for(std::map<std::string,double>::const_iterator p =_reals.begin(); p != _reals.end(); p++) {
     sprintf(tmpBuffer, "%.64e", p->second);
     buffer << convertString(p->first) << " " << tmpBuffer << " ";
   }
 
   buffer << _bools.size() << " ";
-  for(map<string,bool>::const_iterator p = _bools.begin(); p != _bools.end(); p++) {
+  for(std::map<std::string,bool>::const_iterator p = _bools.begin(); p != _bools.end(); p++) {
      buffer << convertString(p->first) << " " << p->second << " ";
   }
 
   buffer << _strings.size() << " ";
-  for(map<string,string>::const_iterator p = _strings.begin(); p != _strings.end(); p++) {
+  for(std::map<std::string,std::string>::const_iterator p = _strings.begin(); p != _strings.end(); p++) {
     buffer << convertString(p->first) << " " <<  convertString(p->second) << " ";
   }
 
   buffer << _realarrays.size() << " ";
-  for(map< string,vector<double> >::const_iterator p = _realarrays.begin(); p != _realarrays.end(); p++) {
-    vector<double> v(p->second);
+  for(std::map< std::string,std::vector<double> >::const_iterator p = _realarrays.begin(); p != _realarrays.end(); p++) {
+    std::vector<double> v(p->second);
     sprintf(tmpBuffer, " %s %d ", convertString(p->first).c_str(), v.size());
     buffer << tmpBuffer;
     for(int i = 0; i<v.size(); i++) {
@@ -653,8 +664,8 @@ TCollection_AsciiString SALOMEDSImpl_AttributeParameter::Save()
   }
 
   buffer << _intarrays.size() << " ";
-  for(map< string,vector<int> >::const_iterator p = _intarrays.begin(); p != _intarrays.end(); p++) {
-    vector<int> v(p->second);
+  for(std::map< std::string,std::vector<int> >::const_iterator p = _intarrays.begin(); p != _intarrays.end(); p++) {
+    std::vector<int> v(p->second);
     sprintf(tmpBuffer, " %s %d ", convertString(p->first).c_str(), v.size());
     buffer << tmpBuffer;
     for(int i = 0; i<v.size(); i++) {
@@ -664,8 +675,8 @@ TCollection_AsciiString SALOMEDSImpl_AttributeParameter::Save()
   }
 
   buffer << _strarrays.size() << " ";
-  for(map< string,vector<string> >::const_iterator p = _strarrays.begin(); p != _strarrays.end(); p++) {
-    vector<string> v(p->second);
+  for(std::map< std::string,std::vector<std::string> >::const_iterator p = _strarrays.begin(); p != _strarrays.end(); p++) {
+    std::vector<std::string> v(p->second);
     sprintf(tmpBuffer, " %s %d ", convertString(p->first).c_str(), v.size());
     buffer << tmpBuffer;
     for(int i = 0; i<v.size(); i++) {
@@ -675,7 +686,7 @@ TCollection_AsciiString SALOMEDSImpl_AttributeParameter::Save()
 
   delete tmpBuffer;
 
-  TCollection_AsciiString AS((char*)buffer.rdbuf()->str());
+  std::string AS = buffer.str();
 
   return AS; 
 }
@@ -686,7 +697,7 @@ TCollection_AsciiString SALOMEDSImpl_AttributeParameter::Save()
  * Purpose  : Restores the attribute from the string
  */
 //=======================================================================
-void SALOMEDSImpl_AttributeParameter::Load(const TCollection_AsciiString& theValue) 
+void SALOMEDSImpl_AttributeParameter::Load(const std::string& theValue) 
 { 
   Backup();
 
@@ -697,11 +708,11 @@ void SALOMEDSImpl_AttributeParameter::Load(const TCollection_AsciiString& theVal
   _realarrays.clear();
   _intarrays.clear();
 
-  istrstream buffer(theValue.ToCString(), strlen(theValue.ToCString()));
+  std::istringstream buffer(theValue.c_str());
 
   int size, val, ival;
   double val2;
-  string s, id;
+  std::string s, id;
 
   buffer >> size;
   for(int i = 1; i<=size; i++) {
@@ -730,7 +741,7 @@ void SALOMEDSImpl_AttributeParameter::Load(const TCollection_AsciiString& theVal
   buffer >> size;
   for(int i = 1; i<=size; i++) {
     buffer >> id >> val;
-    vector<double> v;
+    std::vector<double> v;
     v.resize(val);
     for(int j = 0; j<val; j++) {
       buffer >> val2;
@@ -742,7 +753,7 @@ void SALOMEDSImpl_AttributeParameter::Load(const TCollection_AsciiString& theVal
   buffer >> size;
   for(int i = 1; i<=size; i++) {
     buffer >> id >> val;
-    vector<int> v;
+    std::vector<int> v;
     v.resize(val);
     for(int j = 0; j<val; j++) {
       buffer >> ival;
@@ -754,7 +765,7 @@ void SALOMEDSImpl_AttributeParameter::Load(const TCollection_AsciiString& theVal
   buffer >> size;
   for(int i = 1; i<=size; i++) {
     buffer >> id >> val;
-    vector<string> v;
+    std::vector<std::string> v;
     v.resize(val);
     for(int j = 0; j<val; j++) {
       buffer >> s;