From: srn Date: Thu, 7 Apr 2005 11:31:42 +0000 (+0000) Subject: replaced char* to std::string X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9719a174a16e7c9e9c5e710dd0990cf3168ef545;p=modules%2Fkernel.git replaced char* to std::string --- diff --git a/src/SALOMEDS/SALOMEDS_AttributeComment.cxx b/src/SALOMEDS/SALOMEDS_AttributeComment.cxx index e86e4d5fe..d8555c1e5 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeComment.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeComment.cxx @@ -4,7 +4,8 @@ #include "SALOMEDS_AttributeComment.hxx" -#include +#include +#include #include SALOMEDS_AttributeComment::SALOMEDS_AttributeComment(const Handle(SALOMEDSImpl_AttributeComment)& theAttr) @@ -18,18 +19,18 @@ SALOMEDS_AttributeComment::SALOMEDS_AttributeComment(SALOMEDS::AttributeComment_ SALOMEDS_AttributeComment::~SALOMEDS_AttributeComment() {} -char* SALOMEDS_AttributeComment::Value() +std::string SALOMEDS_AttributeComment::Value() { - TCollection_AsciiString aValue; - if(_isLocal) aValue = Handle(SALOMEDSImpl_AttributeComment)::DownCast(_local_impl)->Value(); + std::string aValue; + if(_isLocal) + aValue = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeComment)::DownCast(_local_impl)->Value()).ToCString(); else aValue = SALOMEDS::AttributeComment::_narrow(_corba_impl)->Value(); - return aValue.ToCString(); + return aValue; } -void SALOMEDS_AttributeComment::SetValue(const char* value) +void SALOMEDS_AttributeComment::SetValue(const std::string& value) { CheckLocked(); - TCollection_AsciiString aValue((char*)value); - if(_isLocal) Handle(SALOMEDSImpl_AttributeComment)::DownCast(_local_impl)->SetValue(aValue); - else SALOMEDS::AttributeComment::_narrow(_corba_impl)->SetValue(aValue.ToCString()); + if(_isLocal) Handle(SALOMEDSImpl_AttributeComment)::DownCast(_local_impl)->SetValue((char*)value.c_str()); + else SALOMEDS::AttributeComment::_narrow(_corba_impl)->SetValue(value.c_str()); } diff --git a/src/SALOMEDS/SALOMEDS_AttributeComment.hxx b/src/SALOMEDS/SALOMEDS_AttributeComment.hxx index fa05f630a..b3638975c 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeComment.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeComment.hxx @@ -21,8 +21,8 @@ public: SALOMEDS_AttributeComment(SALOMEDS::AttributeComment_ptr theAttr); ~SALOMEDS_AttributeComment(); - virtual char* Value(); - virtual void SetValue(const char* value); + virtual std::string Value(); + virtual void SetValue(const std::string& value); }; #endif diff --git a/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef.cxx b/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef.cxx index 9864773bf..01e5c5193 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef.cxx @@ -4,7 +4,8 @@ #include "SALOMEDS_AttributeExternalFileDef.hxx" -#include +#include +#include #include SALOMEDS_AttributeExternalFileDef::SALOMEDS_AttributeExternalFileDef(const Handle(SALOMEDSImpl_AttributeExternalFileDef)& theAttr) @@ -18,18 +19,18 @@ SALOMEDS_AttributeExternalFileDef::SALOMEDS_AttributeExternalFileDef(SALOMEDS::A SALOMEDS_AttributeExternalFileDef::~SALOMEDS_AttributeExternalFileDef() {} -char* SALOMEDS_AttributeExternalFileDef::Value() +std::string SALOMEDS_AttributeExternalFileDef::Value() { - TCollection_AsciiString aValue; - if(_isLocal) aValue = Handle(SALOMEDSImpl_AttributeExternalFileDef)::DownCast(_local_impl)->Value(); + std::string aValue; + if(_isLocal) + aValue = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeExternalFileDef)::DownCast(_local_impl)->Value()).ToCString(); else aValue = SALOMEDS::AttributeExternalFileDef::_narrow(_corba_impl)->Value(); - return aValue.ToCString(); + return aValue; } -void SALOMEDS_AttributeExternalFileDef::SetValue(const char* value) +void SALOMEDS_AttributeExternalFileDef::SetValue(const std::string& value) { CheckLocked(); - TCollection_AsciiString aValue((char*)value); - if(_isLocal) Handle(SALOMEDSImpl_AttributeExternalFileDef)::DownCast(_local_impl)->SetValue(aValue); - else SALOMEDS::AttributeExternalFileDef::_narrow(_corba_impl)->SetValue(aValue.ToCString()); + if(_isLocal) Handle(SALOMEDSImpl_AttributeExternalFileDef)::DownCast(_local_impl)->SetValue((char*)value.c_str()); + else SALOMEDS::AttributeExternalFileDef::_narrow(_corba_impl)->SetValue(value.c_str()); } diff --git a/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef.hxx b/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef.hxx index 916295745..71b9a5f84 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef.hxx @@ -21,8 +21,8 @@ public: SALOMEDS_AttributeExternalFileDef(SALOMEDS::AttributeExternalFileDef_ptr theAttr); ~SALOMEDS_AttributeExternalFileDef(); - virtual char* Value(); - virtual void SetValue(const char* value); + virtual std::string Value(); + virtual void SetValue(const std::string& value); }; #endif diff --git a/src/SALOMEDS/SALOMEDS_AttributeFileType.cxx b/src/SALOMEDS/SALOMEDS_AttributeFileType.cxx index 895edf284..d2cc2c103 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeFileType.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeFileType.cxx @@ -4,7 +4,8 @@ #include "SALOMEDS_AttributeFileType.hxx" -#include +#include +#include #include SALOMEDS_AttributeFileType::SALOMEDS_AttributeFileType(const Handle(SALOMEDSImpl_AttributeFileType)& theAttr) @@ -18,18 +19,18 @@ SALOMEDS_AttributeFileType::SALOMEDS_AttributeFileType(SALOMEDS::AttributeFileTy SALOMEDS_AttributeFileType::~SALOMEDS_AttributeFileType() {} -char* SALOMEDS_AttributeFileType::Value() +std::string SALOMEDS_AttributeFileType::Value() { - TCollection_AsciiString aValue; - if(_isLocal) aValue = Handle(SALOMEDSImpl_AttributeFileType)::DownCast(_local_impl)->Value(); + std::string aValue; + if(_isLocal) + aValue = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeFileType)::DownCast(_local_impl)->Value()).ToCString(); else aValue = SALOMEDS::AttributeFileType::_narrow(_corba_impl)->Value(); - return aValue.ToCString(); + return aValue; } -void SALOMEDS_AttributeFileType::SetValue(const char* value) +void SALOMEDS_AttributeFileType::SetValue(const std::string& value) { CheckLocked(); - TCollection_AsciiString aValue((char*)value); - if(_isLocal) Handle(SALOMEDSImpl_AttributeFileType)::DownCast(_local_impl)->SetValue(aValue); - else SALOMEDS::AttributeFileType::_narrow(_corba_impl)->SetValue(aValue.ToCString()); + if(_isLocal) Handle(SALOMEDSImpl_AttributeFileType)::DownCast(_local_impl)->SetValue((char*)value.c_str()); + else SALOMEDS::AttributeFileType::_narrow(_corba_impl)->SetValue(value.c_str()); } diff --git a/src/SALOMEDS/SALOMEDS_AttributeFileType.hxx b/src/SALOMEDS/SALOMEDS_AttributeFileType.hxx index 39476e2ee..b889d534c 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeFileType.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeFileType.hxx @@ -21,8 +21,8 @@ public: SALOMEDS_AttributeFileType(SALOMEDS::AttributeFileType_ptr theAttr); ~SALOMEDS_AttributeFileType(); - virtual char* Value(); - virtual void SetValue(const char* value); + virtual std::string Value(); + virtual void SetValue(const std::string& value); }; #endif diff --git a/src/SALOMEDS/SALOMEDS_AttributeIOR.cxx b/src/SALOMEDS/SALOMEDS_AttributeIOR.cxx index b8828a9b5..13b54c96b 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeIOR.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeIOR.cxx @@ -4,7 +4,8 @@ #include "SALOMEDS_AttributeIOR.hxx" -#include +#include +#include #include SALOMEDS_AttributeIOR::SALOMEDS_AttributeIOR(const Handle(SALOMEDSImpl_AttributeIOR)& theAttr) @@ -18,18 +19,18 @@ SALOMEDS_AttributeIOR::SALOMEDS_AttributeIOR(SALOMEDS::AttributeIOR_ptr theAttr) SALOMEDS_AttributeIOR::~SALOMEDS_AttributeIOR() {} -char* SALOMEDS_AttributeIOR::Value() +std::string SALOMEDS_AttributeIOR::Value() { - TCollection_AsciiString aValue; - if(_isLocal) aValue = Handle(SALOMEDSImpl_AttributeIOR)::DownCast(_local_impl)->Value(); + std::string aValue; + if(_isLocal) + aValue = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeIOR)::DownCast(_local_impl)->Value()).ToCString(); else aValue = SALOMEDS::AttributeIOR::_narrow(_corba_impl)->Value(); - return aValue.ToCString(); + return aValue; } -void SALOMEDS_AttributeIOR::SetValue(const char* value) +void SALOMEDS_AttributeIOR::SetValue(const std::string& value) { CheckLocked(); - TCollection_AsciiString aValue((char*)value); - if(_isLocal) Handle(SALOMEDSImpl_AttributeIOR)::DownCast(_local_impl)->SetValue(aValue); - else SALOMEDS::AttributeIOR::_narrow(_corba_impl)->SetValue(aValue.ToCString()); + if(_isLocal) Handle(SALOMEDSImpl_AttributeIOR)::DownCast(_local_impl)->SetValue((char*)value.c_str()); + else SALOMEDS::AttributeIOR::_narrow(_corba_impl)->SetValue(value.c_str()); } diff --git a/src/SALOMEDS/SALOMEDS_AttributeIOR.hxx b/src/SALOMEDS/SALOMEDS_AttributeIOR.hxx index d46c4515c..98d383fff 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeIOR.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeIOR.hxx @@ -21,8 +21,8 @@ public: SALOMEDS_AttributeIOR(SALOMEDS::AttributeIOR_ptr theAttr); ~SALOMEDS_AttributeIOR(); - virtual char* Value(); - virtual void SetValue(const char* value); + virtual std::string Value(); + virtual void SetValue(const std::string& value); }; #endif diff --git a/src/SALOMEDS/SALOMEDS_AttributeName.cxx b/src/SALOMEDS/SALOMEDS_AttributeName.cxx index f3636add8..082703ebb 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeName.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeName.cxx @@ -4,7 +4,8 @@ #include "SALOMEDS_AttributeName.hxx" -#include +#include +#include #include SALOMEDS_AttributeName::SALOMEDS_AttributeName(const Handle(SALOMEDSImpl_AttributeName)& theAttr) @@ -18,20 +19,18 @@ SALOMEDS_AttributeName::SALOMEDS_AttributeName(SALOMEDS::AttributeName_ptr theAt SALOMEDS_AttributeName::~SALOMEDS_AttributeName() {} -char* SALOMEDS_AttributeName::Value() +std::string SALOMEDS_AttributeName::Value() { - TCollection_AsciiString aValue; - if(_isLocal) aValue = Handle(SALOMEDSImpl_AttributeName)::DownCast(_local_impl)->Value(); + std::string aValue; + if(_isLocal) + aValue = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeName)::DownCast(_local_impl)->Value()).ToCString(); else aValue = SALOMEDS::AttributeName::_narrow(_corba_impl)->Value(); - - cout << "########################## Attribute Name = " << aValue << endl; - return aValue.ToCString(); + return aValue; } -void SALOMEDS_AttributeName::SetValue(const char* value) +void SALOMEDS_AttributeName::SetValue(const std::string& value) { CheckLocked(); - TCollection_AsciiString aValue((char*)value); - if(_isLocal) Handle(SALOMEDSImpl_AttributeName)::DownCast(_local_impl)->SetValue(aValue); - else SALOMEDS::AttributeName::_narrow(_corba_impl)->SetValue(aValue.ToCString()); + if(_isLocal) Handle(SALOMEDSImpl_AttributeName)::DownCast(_local_impl)->SetValue((char*)value.c_str()); + else SALOMEDS::AttributeName::_narrow(_corba_impl)->SetValue(value.c_str()); } diff --git a/src/SALOMEDS/SALOMEDS_AttributeName.hxx b/src/SALOMEDS/SALOMEDS_AttributeName.hxx index 9599ce5f4..f17634901 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeName.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeName.hxx @@ -21,8 +21,8 @@ public: SALOMEDS_AttributeName(SALOMEDS::AttributeName_ptr theAttr); ~SALOMEDS_AttributeName(); - virtual char* Value(); - virtual void SetValue(const char* value); + virtual std::string Value(); + virtual void SetValue(const std::string& value); }; #endif diff --git a/src/SALOMEDS/SALOMEDS_AttributePersistentRef.cxx b/src/SALOMEDS/SALOMEDS_AttributePersistentRef.cxx index 96a7cc187..4b2f2c96b 100644 --- a/src/SALOMEDS/SALOMEDS_AttributePersistentRef.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributePersistentRef.cxx @@ -4,7 +4,8 @@ #include "SALOMEDS_AttributePersistentRef.hxx" -#include +#include +#include #include SALOMEDS_AttributePersistentRef::SALOMEDS_AttributePersistentRef(const Handle(SALOMEDSImpl_AttributePersistentRef)& theAttr) @@ -18,18 +19,18 @@ SALOMEDS_AttributePersistentRef::SALOMEDS_AttributePersistentRef(SALOMEDS::Attri SALOMEDS_AttributePersistentRef::~SALOMEDS_AttributePersistentRef() {} -char* SALOMEDS_AttributePersistentRef::Value() +std::string SALOMEDS_AttributePersistentRef::Value() { - TCollection_AsciiString aValue; - if(_isLocal) aValue = Handle(SALOMEDSImpl_AttributePersistentRef)::DownCast(_local_impl)->Value(); + std::string aValue; + if(_isLocal) + aValue = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributePersistentRef)::DownCast(_local_impl)->Value()).ToCString(); else aValue = SALOMEDS::AttributePersistentRef::_narrow(_corba_impl)->Value(); - return aValue.ToCString(); + return aValue; } -void SALOMEDS_AttributePersistentRef::SetValue(const char* value) +void SALOMEDS_AttributePersistentRef::SetValue(const std::string& value) { CheckLocked(); - TCollection_AsciiString aValue((char*)value); - if(_isLocal) Handle(SALOMEDSImpl_AttributePersistentRef)::DownCast(_local_impl)->SetValue(aValue); - else SALOMEDS::AttributePersistentRef::_narrow(_corba_impl)->SetValue(aValue.ToCString()); + if(_isLocal) Handle(SALOMEDSImpl_AttributePersistentRef)::DownCast(_local_impl)->SetValue((char*)value.c_str()); + else SALOMEDS::AttributePersistentRef::_narrow(_corba_impl)->SetValue(value.c_str()); } diff --git a/src/SALOMEDS/SALOMEDS_AttributePersistentRef.hxx b/src/SALOMEDS/SALOMEDS_AttributePersistentRef.hxx index dab4ff333..b5b5aaee0 100644 --- a/src/SALOMEDS/SALOMEDS_AttributePersistentRef.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributePersistentRef.hxx @@ -21,8 +21,8 @@ public: SALOMEDS_AttributePersistentRef(SALOMEDS::AttributePersistentRef_ptr theAttr); ~SALOMEDS_AttributePersistentRef(); - virtual char* Value(); - virtual void SetValue(const char* value); + virtual std::string Value(); + virtual void SetValue(const std::string& value); }; #endif diff --git a/src/SALOMEDS/SALOMEDS_AttributePixMap.cxx b/src/SALOMEDS/SALOMEDS_AttributePixMap.cxx index a0e037a37..78df35ce8 100644 --- a/src/SALOMEDS/SALOMEDS_AttributePixMap.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributePixMap.cxx @@ -4,7 +4,8 @@ #include "SALOMEDS_AttributePixMap.hxx" -#include +#include +#include #include SALOMEDS_AttributePixMap::SALOMEDS_AttributePixMap(const Handle(SALOMEDSImpl_AttributePixMap)& theAttr) @@ -25,18 +26,18 @@ bool SALOMEDS_AttributePixMap::HasPixMap() else ret = SALOMEDS::AttributePixMap::_narrow(_corba_impl)->HasPixMap(); } -char* SALOMEDS_AttributePixMap::GetPixMap() +std::string SALOMEDS_AttributePixMap::GetPixMap() { - TCollection_AsciiString aValue; - if(_isLocal) aValue = Handle(SALOMEDSImpl_AttributePixMap)::DownCast(_local_impl)->GetPixMap(); + std::string aValue; + if(_isLocal) + aValue = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributePixMap)::DownCast(_local_impl)->GetPixMap()).ToCString(); else aValue = SALOMEDS::AttributePixMap::_narrow(_corba_impl)->GetPixMap(); - return aValue.ToCString(); + return aValue; } -void SALOMEDS_AttributePixMap::SetPixMap(const char* value) +void SALOMEDS_AttributePixMap::SetPixMap(const std::string& value) { CheckLocked(); - TCollection_AsciiString aValue((char*)value); - if(_isLocal) Handle(SALOMEDSImpl_AttributePixMap)::DownCast(_local_impl)->SetPixMap(aValue); - else SALOMEDS::AttributePixMap::_narrow(_corba_impl)->SetPixMap(aValue.ToCString()); + if(_isLocal) Handle(SALOMEDSImpl_AttributePixMap)::DownCast(_local_impl)->SetPixMap((char*)value.c_str()); + else SALOMEDS::AttributePixMap::_narrow(_corba_impl)->SetPixMap(value.c_str()); } diff --git a/src/SALOMEDS/SALOMEDS_AttributePixMap.hxx b/src/SALOMEDS/SALOMEDS_AttributePixMap.hxx index 882b9b29d..47e6f36ec 100644 --- a/src/SALOMEDS/SALOMEDS_AttributePixMap.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributePixMap.hxx @@ -22,8 +22,8 @@ public: ~SALOMEDS_AttributePixMap(); virtual bool HasPixMap(); - virtual char* GetPixMap(); - virtual void SetPixMap(const char* value); + virtual std::string GetPixMap(); + virtual void SetPixMap(const std::string& value); }; diff --git a/src/SALOMEDS/SALOMEDS_AttributePythonObject.cxx b/src/SALOMEDS/SALOMEDS_AttributePythonObject.cxx index 85b630542..4a3561fb3 100644 --- a/src/SALOMEDS/SALOMEDS_AttributePythonObject.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributePythonObject.cxx @@ -4,7 +4,8 @@ #include "SALOMEDS_AttributePythonObject.hxx" -#include +#include +#include #include SALOMEDS_AttributePythonObject::SALOMEDS_AttributePythonObject(const Handle(SALOMEDSImpl_AttributePythonObject)& theAttr) @@ -26,18 +27,18 @@ bool SALOMEDS_AttributePythonObject::IsScript() return ret; } -char* SALOMEDS_AttributePythonObject::GetObject() +std::string SALOMEDS_AttributePythonObject::GetObject() { - TCollection_AsciiString aValue; - if(_isLocal) aValue = Handle(SALOMEDSImpl_AttributePythonObject)::DownCast(_local_impl)->GetObject(); + std::string aValue; + if(_isLocal) + aValue = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributePythonObject)::DownCast(_local_impl)->GetObject()).ToCString(); else aValue = SALOMEDS::AttributePythonObject::_narrow(_corba_impl)->GetObject(); - return aValue.ToCString(); + return aValue; } -void SALOMEDS_AttributePythonObject::SetObject(const char* theSequence, bool IsScript) +void SALOMEDS_AttributePythonObject::SetObject(const std::string& theSequence, bool IsScript) { CheckLocked(); - TCollection_AsciiString aValue((char*)theSequence); - if(_isLocal) Handle(SALOMEDSImpl_AttributePythonObject)::DownCast(_local_impl)->SetObject(aValue, IsScript); - else SALOMEDS::AttributePythonObject::_narrow(_corba_impl)->SetObject(aValue.ToCString(), IsScript); + if(_isLocal) Handle(SALOMEDSImpl_AttributePythonObject)::DownCast(_local_impl)->SetObject((char*)theSequence.c_str(), IsScript); + else SALOMEDS::AttributePythonObject::_narrow(_corba_impl)->SetObject(theSequence.c_str(), IsScript); } diff --git a/src/SALOMEDS/SALOMEDS_AttributePythonObject.hxx b/src/SALOMEDS/SALOMEDS_AttributePythonObject.hxx index a798fb996..1247df4e7 100644 --- a/src/SALOMEDS/SALOMEDS_AttributePythonObject.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributePythonObject.hxx @@ -21,8 +21,8 @@ public: SALOMEDS_AttributePythonObject(SALOMEDS::AttributePythonObject_ptr theAttr); ~SALOMEDS_AttributePythonObject(); - virtual void SetObject(const char* theSequence, bool IsScript); - virtual char* GetObject(); + virtual void SetObject(const std::string& theSequence, bool IsScript); + virtual std::string GetObject(); virtual bool IsScript(); }; diff --git a/src/SALOMEDS/SALOMEDS_AttributeStudyProperties.cxx b/src/SALOMEDS/SALOMEDS_AttributeStudyProperties.cxx index 1e942f01b..092c5a417 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeStudyProperties.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeStudyProperties.cxx @@ -4,7 +4,8 @@ #include "SALOMEDS_AttributeStudyProperties.hxx" -#include +#include +#include #include #include #include @@ -22,19 +23,21 @@ SALOMEDS_AttributeStudyProperties::~SALOMEDS_AttributeStudyProperties() { } -void SALOMEDS_AttributeStudyProperties::SetUserName(const char* theName) +void SALOMEDS_AttributeStudyProperties::SetUserName(const std::string& theName) { - TCollection_AsciiString aName((char*)theName); - if(_isLocal) Handle(SALOMEDSImpl_AttributeStudyProperties)::DownCast(_local_impl)->SetUserName(aName); - else SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->SetUserName(aName.ToCString()); + if(_isLocal) Handle(SALOMEDSImpl_AttributeStudyProperties)::DownCast(_local_impl)->SetUserName((char*)theName.c_str()); + else SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->SetUserName(theName.c_str()); } -char* SALOMEDS_AttributeStudyProperties::GetUserName() +std::string SALOMEDS_AttributeStudyProperties::GetUserName() { - TCollection_AsciiString aName; - if(_isLocal) aName = Handle(SALOMEDSImpl_AttributeStudyProperties)::DownCast(_local_impl)->GetCreatorName(); + std::string aName; + if(_isLocal) { + TCollection_AsciiString N = Handle(SALOMEDSImpl_AttributeStudyProperties)::DownCast(_local_impl)->GetCreatorName(); + aName = N.ToCString(); + } else aName = SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->GetUserName(); - return aName.ToCString(); + return aName; } void SALOMEDS_AttributeStudyProperties::SetCreationDate(int theMinute, int theHour, int theDay, int theMonth, int theYear) @@ -78,30 +81,29 @@ bool SALOMEDS_AttributeStudyProperties::GetCreationDate(int& theMinute, return ret; } -void SALOMEDS_AttributeStudyProperties::SetCreationMode(const char* theMode) +void SALOMEDS_AttributeStudyProperties::SetCreationMode(const std::string& theMode) { - TCollection_AsciiString aMode((char*)theMode); if(_isLocal) { - if(aMode == "from scratch") + if(theMode == "from scratch") Handle(SALOMEDSImpl_AttributeStudyProperties)::DownCast(_local_impl)->SetCreationMode(1); - else if(aMode == "copy from") + else if(theMode == "copy from") Handle(SALOMEDSImpl_AttributeStudyProperties)::DownCast(_local_impl)->SetCreationMode(2); else //Not defined Handle(SALOMEDSImpl_AttributeStudyProperties)::DownCast(_local_impl)->SetCreationMode(0); } - else SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->SetCreationMode(aMode.ToCString()); + else SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->SetCreationMode(theMode.c_str()); } -char* SALOMEDS_AttributeStudyProperties::GetCreationMode() +std::string SALOMEDS_AttributeStudyProperties::GetCreationMode() { - TCollection_AsciiString aMode; + std::string aMode; if(_isLocal) { int mode = Handle(SALOMEDSImpl_AttributeStudyProperties)::DownCast(_local_impl)->GetCreationMode(); if(mode == 1) aMode = "from scratch"; if(mode == 2) aMode = "copy from"; } else aMode = SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->GetCreationMode(); - return aMode.ToCString(); + return aMode; } void SALOMEDS_AttributeStudyProperties::SetModified(int theModified) @@ -140,23 +142,22 @@ bool SALOMEDS_AttributeStudyProperties::IsLocked() return ret; } -void SALOMEDS_AttributeStudyProperties::SetModification(const char* theName, +void SALOMEDS_AttributeStudyProperties::SetModification(const std::string& theName, int theMinute, int theHour, int theDay, int theMonth, int theYear) { - TCollection_AsciiString aName((char*)theName); if(_isLocal) { - Handle(SALOMEDSImpl_AttributeStudyProperties)::DownCast(_local_impl)->SetUserName(aName); + Handle(SALOMEDSImpl_AttributeStudyProperties)::DownCast(_local_impl)->SetUserName((char*)theName.c_str()); Handle(SALOMEDSImpl_AttributeStudyProperties)::DownCast(_local_impl)->SetModificationDate(theMinute, theHour, theDay, theMonth, theYear); } - else SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->SetModification(aName.ToCString(), + else SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->SetModification(theName.c_str(), theMinute, theHour, theDay, diff --git a/src/SALOMEDS/SALOMEDS_AttributeStudyProperties.hxx b/src/SALOMEDS/SALOMEDS_AttributeStudyProperties.hxx index 5142998a9..39c2af10b 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeStudyProperties.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeStudyProperties.hxx @@ -25,18 +25,18 @@ public: SALOMEDS_AttributeStudyProperties(SALOMEDS::AttributeStudyProperties_ptr theAttr); ~SALOMEDS_AttributeStudyProperties(); - virtual void SetUserName(const char* theName); - virtual char* GetUserName(); + virtual void SetUserName(const std::string& theName); + virtual std::string GetUserName(); virtual void SetCreationDate(int theMinute, int theHour, int theDay, int theMonth, int theYear); virtual bool GetCreationDate(int& theMinute, int& theHour, int& theDay, int& theMonth, int& theYear); - virtual void SetCreationMode(const char* theMode); - virtual char* GetCreationMode(); + virtual void SetCreationMode(const std::string& theMode); + virtual std::string GetCreationMode(); virtual void SetModified(int theModified); virtual bool IsModified(); virtual int GetModified(); virtual void SetLocked(bool theLocked); virtual bool IsLocked(); - virtual void SetModification(const char* theName, + virtual void SetModification(const std::string& theName, int theMinute, int theHour, int theDay, diff --git a/src/SALOMEDS/SALOMEDS_AttributeTableOfInteger.cxx b/src/SALOMEDS/SALOMEDS_AttributeTableOfInteger.cxx index 34652c322..d72bd44ff 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTableOfInteger.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTableOfInteger.cxx @@ -23,28 +23,28 @@ SALOMEDS_AttributeTableOfInteger::~SALOMEDS_AttributeTableOfInteger() {} -void SALOMEDS_AttributeTableOfInteger::SetTitle(const char* theTitle) +void SALOMEDS_AttributeTableOfInteger::SetTitle(const std::string& theTitle) { CheckLocked(); - TCollection_AsciiString aStr((char*)theTitle); - if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->SetTitle(aStr); - else SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetTitle(aStr.ToCString()); + if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->SetTitle((char*)theTitle.c_str()); + else SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetTitle(theTitle.c_str()); } -char* SALOMEDS_AttributeTableOfInteger::GetTitle() +std::string SALOMEDS_AttributeTableOfInteger::GetTitle() { - TCollection_AsciiString aStr; - if(_isLocal) aStr = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->GetTitle(); + std::string aStr; + if(_isLocal) + aStr = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->GetTitle()).ToCString(); else aStr = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetTitle(); - return aStr.ToCString(); + return aStr; } -void SALOMEDS_AttributeTableOfInteger::SetRowTitle(int theIndex, const char* theTitle) +void SALOMEDS_AttributeTableOfInteger::SetRowTitle(int theIndex, const std::string& theTitle) { CheckLocked(); - TCollection_AsciiString aTitle((char*)theTitle); - if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->SetRowTitle(theIndex, aTitle); - else SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetRowTitle(theIndex, aTitle.ToCString()); + if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->SetRowTitle(theIndex, + (char*)theTitle.c_str()); + else SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetRowTitle(theIndex, theTitle.c_str()); } void SALOMEDS_AttributeTableOfInteger::SetRowTitles(const std::vector& theTitles) @@ -59,7 +59,7 @@ void SALOMEDS_AttributeTableOfInteger::SetRowTitles(const std::vectorlength(aLength); - for(i = 0; i < aLength; i++) aSeq[i] = TCollection_AsciiString((char*)theTitles[i].c_str()).ToCString(); + for(i = 0; i < aLength; i++) aSeq[i] = theTitles[i].c_str(); SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetRowTitles(aSeq); } @@ -73,22 +73,23 @@ std::vector SALOMEDS_AttributeTableOfInteger::GetRowTitles() Handle(TColStd_HSequenceOfExtendedString) aSeq; aSeq = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->GetRowTitles(); aLength = aSeq->Length(); - for(i = 1; i<= aLength; i++) aVector.push_back(TCollection_AsciiString(aSeq->Value(i)).ToCString()); + for(i = 1; i<= aLength; i++) aVector.push_back(TCollection_AsciiString((aSeq->Value(i))).ToCString()); } else { SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetRowTitles(); aLength = aSeq->length(); - for(i = 0; iSetColumnTitle(theIndex, aStr); - else SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetColumnTitle(theIndex, aStr.ToCString()); + if(_isLocal) + Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->SetColumnTitle(theIndex, + (char*)theTitle.c_str()); + else SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetColumnTitle(theIndex, theTitle.c_str()); } void SALOMEDS_AttributeTableOfInteger::SetColumnTitles(const std::vector& theTitles) @@ -103,7 +104,7 @@ void SALOMEDS_AttributeTableOfInteger::SetColumnTitles(const std::vectorlength(aLength); - for(i = 0; i < aLength; i++) aSeq[i] = TCollection_AsciiString((char*)theTitles[i].c_str()).ToCString(); + for(i = 0; i < aLength; i++) aSeq[i] = theTitles[i].c_str(); SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetColumnTitles(aSeq); } } @@ -121,17 +122,17 @@ std::vector SALOMEDS_AttributeTableOfInteger::GetColumnTitles() else { SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetColumnTitles(); aLength = aSeq->length(); - for(i = 0; iSetRowUnit(theIndex, aUnit); - else SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetRowUnit(theIndex, aUnit.ToCString()); + if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_local_impl)->SetRowUnit(theIndex, + (char*)theUnit.c_str()); + else SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetRowUnit(theIndex, theUnit.c_str()); } void SALOMEDS_AttributeTableOfInteger::SetRowUnits(const std::vector& theUnits) @@ -146,7 +147,7 @@ void SALOMEDS_AttributeTableOfInteger::SetRowUnits(const std::vectorlength(aLength); - for(i = 0; i < aLength; i++) aSeq[i] = TCollection_AsciiString((char*)theUnits[i].c_str()).ToCString(); + for(i = 0; i < aLength; i++) aSeq[i] = (char*)theUnits[i].c_str(); SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetRowUnits(aSeq); } } @@ -164,7 +165,7 @@ std::vector SALOMEDS_AttributeTableOfInteger::GetRowUnits() else { SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetRowUnits(); aLength = aSeq->length(); - for(i = 0; i& theTitles); virtual std::vector GetRowTitles(); - virtual void SetColumnTitle(int theIndex, const char* theTitle); + virtual void SetColumnTitle(int theIndex, const std::string& theTitle); virtual void SetColumnTitles(const std::vector& theTitles); virtual std::vector GetColumnTitles(); - virtual void SetRowUnit(int theIndex, const char* theUnit); + virtual void SetRowUnit(int theIndex, const std::string& theUnit); virtual void SetRowUnits(const std::vector& theUnits); virtual std::vector GetRowUnits(); diff --git a/src/SALOMEDS/SALOMEDS_AttributeTableOfReal.cxx b/src/SALOMEDS/SALOMEDS_AttributeTableOfReal.cxx index 87cbb573d..89c5935fa 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTableOfReal.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTableOfReal.cxx @@ -24,28 +24,28 @@ SALOMEDS_AttributeTableOfReal::~SALOMEDS_AttributeTableOfReal() {} -void SALOMEDS_AttributeTableOfReal::SetTitle(const char* theTitle) +void SALOMEDS_AttributeTableOfReal::SetTitle(const std::string& theTitle) { CheckLocked(); - TCollection_AsciiString aStr((char*)theTitle); - if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->SetTitle(aStr); - else SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetTitle(aStr.ToCString()); + if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->SetTitle((char*)theTitle.c_str()); + else SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetTitle(theTitle.c_str()); } -char* SALOMEDS_AttributeTableOfReal::GetTitle() +std::string SALOMEDS_AttributeTableOfReal::GetTitle() { - TCollection_AsciiString aStr; - if(_isLocal) aStr = Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->GetTitle(); + std::string aStr; + if(_isLocal) + aStr = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->GetTitle()).ToCString(); else aStr = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetTitle(); - return aStr.ToCString(); + return aStr; } -void SALOMEDS_AttributeTableOfReal::SetRowTitle(int theIndex, const char* theTitle) +void SALOMEDS_AttributeTableOfReal::SetRowTitle(int theIndex, const std::string& theTitle) { CheckLocked(); - TCollection_AsciiString aTitle((char*)theTitle); - if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->SetRowTitle(theIndex, aTitle); - else SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetRowTitle(theIndex, aTitle.ToCString()); + if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->SetRowTitle(theIndex, + (char*)theTitle.c_str()); + else SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetRowTitle(theIndex, theTitle.c_str()); } void SALOMEDS_AttributeTableOfReal::SetRowTitles(const std::vector& theTitles) @@ -60,7 +60,7 @@ void SALOMEDS_AttributeTableOfReal::SetRowTitles(const std::vector& else { SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq(); aSeq->length(aLength); - for(i = 0; i < aLength; i++) aSeq[i] = TCollection_AsciiString((char*)theTitles[i].c_str()).ToCString(); + for(i = 0; i < aLength; i++) aSeq[i] = (char*)theTitles[i].c_str(); SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetRowTitles(aSeq); } @@ -79,17 +79,17 @@ std::vector SALOMEDS_AttributeTableOfReal::GetRowTitles() else { SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetRowTitles(); aLength = aSeq->length(); - for(i = 0; iSetColumnTitle(theIndex, aStr); - else SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetColumnTitle(theIndex, aStr.ToCString()); + if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->SetColumnTitle(theIndex, + (char*)theTitle.c_str()); + else SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetColumnTitle(theIndex, theTitle.c_str()); } void SALOMEDS_AttributeTableOfReal::SetColumnTitles(const std::vector& theTitles) @@ -104,7 +104,7 @@ void SALOMEDS_AttributeTableOfReal::SetColumnTitles(const std::vectorlength(aLength); - for(i = 0; i < aLength; i++) aSeq[i] = TCollection_AsciiString((char*)theTitles[i].c_str()).ToCString(); + for(i = 0; i < aLength; i++) aSeq[i] = (char*)theTitles[i].c_str(); SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetColumnTitles(aSeq); } } @@ -122,17 +122,17 @@ std::vector SALOMEDS_AttributeTableOfReal::GetColumnTitles() else { SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetColumnTitles(); aLength = aSeq->length(); - for(i = 0; iSetRowUnit(theIndex, aUnit); - else SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetRowUnit(theIndex, aUnit.ToCString()); + if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_local_impl)->SetRowUnit(theIndex, + (char*)theUnit.c_str()); + else SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetRowUnit(theIndex, theUnit.c_str()); } void SALOMEDS_AttributeTableOfReal::SetRowUnits(const std::vector& theUnits) @@ -147,7 +147,7 @@ void SALOMEDS_AttributeTableOfReal::SetRowUnits(const std::vector& else { SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq(); aSeq->length(aLength); - for(i = 0; i < aLength; i++) aSeq[i] = TCollection_AsciiString((char*)theUnits[i].c_str()).ToCString(); + for(i = 0; i < aLength; i++) aSeq[i] = (char*)theUnits[i].c_str(); SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetRowUnits(aSeq); } } diff --git a/src/SALOMEDS/SALOMEDS_AttributeTableOfReal.hxx b/src/SALOMEDS/SALOMEDS_AttributeTableOfReal.hxx index 83864e255..755058cab 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTableOfReal.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTableOfReal.hxx @@ -23,16 +23,16 @@ public: SALOMEDS_AttributeTableOfReal(SALOMEDS::AttributeTableOfReal_ptr theAttr); ~SALOMEDS_AttributeTableOfReal(); - virtual void SetTitle(const char* theTitle); - virtual char* GetTitle(); - virtual void SetRowTitle(int theIndex, const char* theTitle); + virtual void SetTitle(const std::string& theTitle); + virtual std::string GetTitle(); + virtual void SetRowTitle(int theIndex, const std::string& theTitle); virtual void SetRowTitles(const std::vector& theTitles); virtual std::vector GetRowTitles(); - virtual void SetColumnTitle(int theIndex, const char* theTitle); + virtual void SetColumnTitle(int theIndex, const std::string& theTitle); virtual void SetColumnTitles(const std::vector& theTitles); virtual std::vector GetColumnTitles(); - virtual void SetRowUnit(int theIndex, const char* theUnit); + virtual void SetRowUnit(int theIndex, const std::string& theUnit); virtual void SetRowUnits(const std::vector& theUnits); virtual std::vector GetRowUnits(); diff --git a/src/SALOMEDS/SALOMEDS_AttributeTableOfString.cxx b/src/SALOMEDS/SALOMEDS_AttributeTableOfString.cxx index c8ae1ed30..dff594c8d 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTableOfString.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTableOfString.cxx @@ -4,7 +4,8 @@ #include "SALOMEDS_AttributeTableOfString.hxx" -#include +#include +#include #include #include #include @@ -23,28 +24,28 @@ SALOMEDS_AttributeTableOfString::~SALOMEDS_AttributeTableOfString() {} -void SALOMEDS_AttributeTableOfString::SetTitle(const char* theTitle) +void SALOMEDS_AttributeTableOfString::SetTitle(const std::string& theTitle) { CheckLocked(); - TCollection_AsciiString aStr((char*)theTitle); - if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->SetTitle(aStr); - else SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetTitle(aStr.ToCString()); + if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->SetTitle((char*)theTitle.c_str()); + else SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetTitle(theTitle.c_str()); } -char* SALOMEDS_AttributeTableOfString::GetTitle() +std::string SALOMEDS_AttributeTableOfString::GetTitle() { - TCollection_AsciiString aStr; - if(_isLocal) aStr = Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->GetTitle(); + std::string aStr; + if(_isLocal) + aStr = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->GetTitle()).ToCString(); else aStr = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetTitle(); - return aStr.ToCString(); + return aStr; } -void SALOMEDS_AttributeTableOfString::SetRowTitle(int theIndex, const char* theTitle) +void SALOMEDS_AttributeTableOfString::SetRowTitle(int theIndex, const std::string& theTitle) { CheckLocked(); - TCollection_AsciiString aTitle((char*)theTitle); - if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->SetRowTitle(theIndex, aTitle); - else SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetRowTitle(theIndex, aTitle.ToCString()); + if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->SetRowTitle(theIndex, + (char*)theTitle.c_str()); + else SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetRowTitle(theIndex, theTitle.c_str()); } void SALOMEDS_AttributeTableOfString::SetRowTitles(const std::vector& theTitles) @@ -59,7 +60,7 @@ void SALOMEDS_AttributeTableOfString::SetRowTitles(const std::vectorlength(aLength); - for(i = 0; i < aLength; i++) aSeq[i] = TCollection_AsciiString((char*)theTitles[i].c_str()).ToCString(); + for(i = 0; i < aLength; i++) aSeq[i] = (char*)theTitles[i].c_str(); SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetRowTitles(aSeq); } @@ -78,17 +79,17 @@ std::vector SALOMEDS_AttributeTableOfString::GetRowTitles() else { SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetRowTitles(); aLength = aSeq->length(); - for(i = 0; iSetColumnTitle(theIndex, aStr); - else SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetColumnTitle(theIndex, aStr.ToCString()); + if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->SetColumnTitle(theIndex, + (char*)theTitle.c_str()); + else SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetColumnTitle(theIndex, theTitle.c_str()); } void SALOMEDS_AttributeTableOfString::SetColumnTitles(const std::vector& theTitles) @@ -103,7 +104,7 @@ void SALOMEDS_AttributeTableOfString::SetColumnTitles(const std::vectorlength(aLength); - for(i = 0; i < aLength; i++) aSeq[i] = TCollection_AsciiString((char*)theTitles[i].c_str()).ToCString(); + for(i = 0; i < aLength; i++) aSeq[i] = (char*)theTitles[i].c_str(); SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetColumnTitles(aSeq); } } @@ -121,17 +122,17 @@ std::vector SALOMEDS_AttributeTableOfString::GetColumnTitles() else { SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetColumnTitles(); aLength = aSeq->length(); - for(i = 0; iSetRowUnit(theIndex, aUnit); - else SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetRowUnit(theIndex, aUnit.ToCString()); + if(_isLocal) Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->SetRowUnit(theIndex, + (char*)theUnit.c_str()); + else SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetRowUnit(theIndex, theUnit.c_str()); } void SALOMEDS_AttributeTableOfString::SetRowUnits(const std::vector& theUnits) @@ -146,7 +147,7 @@ void SALOMEDS_AttributeTableOfString::SetRowUnits(const std::vector else { SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq(); aSeq->length(aLength); - for(i = 0; i < aLength; i++) aSeq[i] = TCollection_AsciiString((char*)theUnits[i].c_str()).ToCString(); + for(i = 0; i < aLength; i++) aSeq[i] = (char*)theUnits[i].c_str(); SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetRowUnits(aSeq); } } @@ -164,7 +165,7 @@ std::vector SALOMEDS_AttributeTableOfString::GetRowUnits() else { SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetRowUnits(); aLength = aSeq->length(); - for(i = 0; i& the else { SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq(); aSeq->length(aLength); - for(i = 0; i < aLength; i++) aSeq[i] = TCollection_AsciiString((char*)theData[i].c_str()).ToCString(); + for(i = 0; i < aLength; i++) aSeq[i] = (char*)theData[i].c_str(); SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->AddRow(aSeq); } } @@ -229,7 +230,7 @@ void SALOMEDS_AttributeTableOfString::SetRow(int theRow, const std::vectorlength(aLength); - for(i = 0; i < aLength; i++) aSeq[i] = TCollection_AsciiString((char*)theData[i].c_str()).ToCString(); + for(i = 0; i < aLength; i++) aSeq[i] = (char*)theData[i].c_str(); SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetRow(theRow, aSeq); } } @@ -246,7 +247,7 @@ std::vector SALOMEDS_AttributeTableOfString::GetRow(int theRow) } else { SALOMEDS::StringSeq_var aRow = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetRow(theRow); - for(i = 0; i < aLength; i++) aVector.push_back(TCollection_AsciiString((char*)aRow[i].in()).ToCString()); + for(i = 0; i < aLength; i++) aVector.push_back((char*)aRow[i].in()); } return aVector; @@ -271,7 +272,7 @@ void SALOMEDS_AttributeTableOfString::AddColumn(const std::vector& else { SALOMEDS::StringSeq_var aColumn = new SALOMEDS::StringSeq(); aColumn->length(aLength); - for(i = 0; i < aLength; i++) aColumn[i] = TCollection_AsciiString((char*)theData[i].c_str()).ToCString(); + for(i = 0; i < aLength; i++) aColumn[i] = (char*)theData[i].c_str(); SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->AddColumn(aColumn); } } @@ -295,7 +296,7 @@ void SALOMEDS_AttributeTableOfString::SetColumn(int theColumn, const std::vector else { SALOMEDS::StringSeq_var aColumn = new SALOMEDS::StringSeq(); aColumn->length(aLength); - for(i = 0; i < aLength; i++) aColumn[i] = TCollection_AsciiString((char*)theData[i].c_str()).ToCString(); + for(i = 0; i < aLength; i++) aColumn[i] = (char*)theData[i].c_str(); SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->SetRow(theColumn, aColumn); } } @@ -317,20 +318,21 @@ std::vector SALOMEDS_AttributeTableOfString::GetColumn(int theColum return aVector; } -void SALOMEDS_AttributeTableOfString::PutValue(const char* theValue, int theRow, int theColumn) +void SALOMEDS_AttributeTableOfString::PutValue(const std::string& theValue, int theRow, int theColumn) { CheckLocked(); - TCollection_AsciiString aValue((char*)theValue); if(_isLocal) { try { - Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->PutValue(aValue, theRow, theColumn); + Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->PutValue((char*)theValue.c_str(), + theRow, + theColumn); } catch(...) { throw SALOMEDS::AttributeTableOfString::IncorrectIndex(); } } else { - SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->PutValue(aValue.ToCString(), theRow, theColumn); + SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->PutValue(theValue.c_str(), theRow, theColumn); } } @@ -342,12 +344,14 @@ bool SALOMEDS_AttributeTableOfString::HasValue(int theRow, int theColumn) return ret; } -char* SALOMEDS_AttributeTableOfString::GetValue(int theRow, int theColumn) +std::string SALOMEDS_AttributeTableOfString::GetValue(int theRow, int theColumn) { - TCollection_AsciiString aValue; + std::string aValue; if(_isLocal) { try { - aValue = Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->GetValue(theRow, theColumn); + aValue = + TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_local_impl)->GetValue(theRow, + theColumn)).ToCString(); } catch(...) { throw SALOMEDS::AttributeTableOfString::IncorrectIndex(); @@ -356,7 +360,7 @@ char* SALOMEDS_AttributeTableOfString::GetValue(int theRow, int theColumn) else { aValue = SALOMEDS::AttributeTableOfString::_narrow(_corba_impl)->GetValue(theRow, theColumn); } - return aValue.ToCString(); + return aValue; } std::vector SALOMEDS_AttributeTableOfString::GetRowSetIndices(int theRow) diff --git a/src/SALOMEDS/SALOMEDS_AttributeTableOfString.hxx b/src/SALOMEDS/SALOMEDS_AttributeTableOfString.hxx index 269951ff2..cfffe3e27 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTableOfString.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTableOfString.hxx @@ -23,16 +23,16 @@ public: SALOMEDS_AttributeTableOfString(SALOMEDS::AttributeTableOfString_ptr theAttr); ~SALOMEDS_AttributeTableOfString(); - virtual void SetTitle(const char* theTitle); - virtual char* GetTitle(); - virtual void SetRowTitle(int theIndex, const char* theTitle); + virtual void SetTitle(const std::string& theTitle); + virtual std::string GetTitle(); + virtual void SetRowTitle(int theIndex, const std::string& theTitle); virtual void SetRowTitles(const std::vector& theTitles); virtual std::vector GetRowTitles(); - virtual void SetColumnTitle(int theIndex, const char* theTitle); + virtual void SetColumnTitle(int theIndex, const std::string& theTitle); virtual void SetColumnTitles(const std::vector& theTitles); virtual std::vector GetColumnTitles(); - virtual void SetRowUnit(int theIndex, const char* theUnit); + virtual void SetRowUnit(int theIndex, const std::string& theUnit); virtual void SetRowUnits(const std::vector& theUnits); virtual std::vector GetRowUnits(); @@ -44,9 +44,9 @@ public: virtual void AddColumn(const std::vector& theData); virtual void SetColumn(int theColumn, const std::vector& theData); virtual std::vector GetColumn(int theColumn); - virtual void PutValue(const char* theValue, int theRow, int theColumn); + virtual void PutValue(const std::string& theValue, int theRow, int theColumn); virtual bool HasValue(int theRow, int theColumn); - virtual char* GetValue(int theRow, int theColumn); + virtual std::string GetValue(int theRow, int theColumn); virtual std::vector GetRowSetIndices(int theRow); virtual void SetNbColumns(int theNbColumns); diff --git a/src/SALOMEDS/SALOMEDS_AttributeTreeNode.cxx b/src/SALOMEDS/SALOMEDS_AttributeTreeNode.cxx index 80d45b4a8..7fb7a79dc 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTreeNode.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTreeNode.cxx @@ -4,6 +4,7 @@ #include "SALOMEDS_AttributeTreeNode.hxx" +#include #include #include #include @@ -200,19 +201,19 @@ SALOMEDSClient_AttributeTreeNode* SALOMEDS_AttributeTreeNode::GetFirst() return aTN; } -void SALOMEDS_AttributeTreeNode::SetTreeID(const char* value) +void SALOMEDS_AttributeTreeNode::SetTreeID(const std::string& value) { if(_isLocal) { Handle(SALOMEDSImpl_AttributeTreeNode) aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl); - aNode->SetTreeID(Standard_GUID((char*)value)); + aNode->SetTreeID(Standard_GUID((char*)value.c_str())); } else { SALOMEDS::AttributeTreeNode_var aNode = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl); - aNode->SetTreeID(value); + aNode->SetTreeID(value.c_str()); } } -char* SALOMEDS_AttributeTreeNode::GetTreeID() +std::string SALOMEDS_AttributeTreeNode::GetTreeID() { TCollection_AsciiString aGUID; if(_isLocal) { @@ -226,7 +227,7 @@ char* SALOMEDS_AttributeTreeNode::GetTreeID() aGUID = TCollection_AsciiString(aNode->GetTreeID()); } - return aGUID.ToCString(); + return std::string(aGUID.ToCString()); } void SALOMEDS_AttributeTreeNode::Append(SALOMEDSClient_AttributeTreeNode* value) @@ -369,12 +370,12 @@ bool SALOMEDS_AttributeTreeNode::IsChild(SALOMEDSClient_AttributeTreeNode* value return ret; } -char* SALOMEDS_AttributeTreeNode::Label() +std::string SALOMEDS_AttributeTreeNode::Label() { TCollection_AsciiString aLabel; if(_isLocal) TDF_Tool::Entry(_local_impl->Label(), aLabel); else aLabel = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl)->Label(); - return aLabel.ToCString(); + return std::string(aLabel.ToCString()); } diff --git a/src/SALOMEDS/SALOMEDS_AttributeTreeNode.hxx b/src/SALOMEDS/SALOMEDS_AttributeTreeNode.hxx index 2fec33ddd..6e3eca45b 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTreeNode.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTreeNode.hxx @@ -33,8 +33,8 @@ public: virtual void SetFirst(SALOMEDSClient_AttributeTreeNode* value); virtual bool HasFirst(); virtual SALOMEDSClient_AttributeTreeNode* GetFirst(); - virtual void SetTreeID(const char* value); - virtual char* GetTreeID(); + virtual void SetTreeID(const std::string& value); + virtual std::string GetTreeID(); virtual void Append(SALOMEDSClient_AttributeTreeNode* value); virtual void Prepend(SALOMEDSClient_AttributeTreeNode* value); virtual void InsertBefore(SALOMEDSClient_AttributeTreeNode* value); @@ -45,7 +45,7 @@ public: virtual bool IsDescendant(SALOMEDSClient_AttributeTreeNode* value); virtual bool IsFather(SALOMEDSClient_AttributeTreeNode* value); virtual bool IsChild(SALOMEDSClient_AttributeTreeNode* value); - virtual char* Label(); + virtual std::string Label(); }; #endif diff --git a/src/SALOMEDS/SALOMEDS_AttributeUserID.cxx b/src/SALOMEDS/SALOMEDS_AttributeUserID.cxx index bbd11fb82..cc120dbf6 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeUserID.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeUserID.cxx @@ -4,7 +4,8 @@ #include "SALOMEDS_AttributeUserID.hxx" -#include +#include +#include #include #include @@ -19,22 +20,21 @@ SALOMEDS_AttributeUserID::SALOMEDS_AttributeUserID(SALOMEDS::AttributeUserID_ptr SALOMEDS_AttributeUserID::~SALOMEDS_AttributeUserID() {} -char* SALOMEDS_AttributeUserID::Value() +std::string SALOMEDS_AttributeUserID::Value() { - TCollection_AsciiString aValue; + std::string aValue; if(_isLocal) { char guid[40]; Handle(SALOMEDSImpl_AttributeUserID)::DownCast(_local_impl)->Value().ToCString(guid); - aValue = TCollection_AsciiString(guid); + aValue = std::string(guid); } else aValue = SALOMEDS::AttributeUserID::_narrow(_corba_impl)->Value(); - return aValue.ToCString(); + return aValue; } -void SALOMEDS_AttributeUserID::SetValue(const char* value) +void SALOMEDS_AttributeUserID::SetValue(const std::string& value) { CheckLocked(); - TCollection_AsciiString aValue((char*)value); - if(_isLocal) Handle(SALOMEDSImpl_AttributeUserID)::DownCast(_local_impl)->SetValue(Standard_GUID(aValue.ToCString())); - else SALOMEDS::AttributeUserID::_narrow(_corba_impl)->SetValue(aValue.ToCString()); + if(_isLocal) Handle(SALOMEDSImpl_AttributeUserID)::DownCast(_local_impl)->SetValue(Standard_GUID((char*)value.c_str())); + else SALOMEDS::AttributeUserID::_narrow(_corba_impl)->SetValue(value.c_str()); } diff --git a/src/SALOMEDS/SALOMEDS_AttributeUserID.hxx b/src/SALOMEDS/SALOMEDS_AttributeUserID.hxx index f8bff63e4..9ff898001 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeUserID.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeUserID.hxx @@ -21,8 +21,8 @@ public: SALOMEDS_AttributeUserID(SALOMEDS::AttributeUserID_ptr theAttr); ~SALOMEDS_AttributeUserID(); - virtual char* Value(); - virtual void SetValue(const char* value); + virtual std::string Value(); + virtual void SetValue(const std::string& value); }; #endif diff --git a/src/SALOMEDS/SALOMEDS_ClientAttributes.hxx b/src/SALOMEDS/SALOMEDS_ClientAttributes.hxx index a785389b0..9f45d7e75 100644 --- a/src/SALOMEDS/SALOMEDS_ClientAttributes.hxx +++ b/src/SALOMEDS/SALOMEDS_ClientAttributes.hxx @@ -67,12 +67,12 @@ #include "SALOMEDS_AttributeFlags.hxx" #include "SALOMEDS_AttributeGraphic.hxx" -#define __CreateClientAttributeLocal(CORBA_Name) if (strcmp(aTypeOfAttribute, #CORBA_Name) == 0) { \ +#define __CreateClientAttributeLocal(CORBA_Name) if (strcmp(aTypeOfAttribute.c_str(), #CORBA_Name) == 0) { \ Handle(SALOMEDSImpl_##CORBA_Name) A = Handle(SALOMEDSImpl_##CORBA_Name)::DownCast(theGA); \ aGA = new SALOMEDS_##CORBA_Name(A); \ } -#define __CreateClientAttributeCORBA(CORBA_Name) if (strcmp(aTypeOfAttribute, #CORBA_Name) == 0) { \ +#define __CreateClientAttributeCORBA(CORBA_Name) if (strcmp(aTypeOfAttribute.c_str(), #CORBA_Name) == 0) { \ SALOMEDS::CORBA_Name##_var A = SALOMEDS::CORBA_Name::_narrow(theGA); \ aGA = new SALOMEDS_##CORBA_Name(A); \ } diff --git a/src/SALOMEDS/SALOMEDS_GenericAttribute.cxx b/src/SALOMEDS/SALOMEDS_GenericAttribute.cxx index 440893473..89c29a20d 100644 --- a/src/SALOMEDS/SALOMEDS_GenericAttribute.cxx +++ b/src/SALOMEDS/SALOMEDS_GenericAttribute.cxx @@ -4,7 +4,8 @@ using namespace std; -#include +#include +#include #include "SALOMEDS_GenericAttribute.hxx" #include "SALOMEDSImpl_SObject.hxx" @@ -66,28 +67,28 @@ void SALOMEDS_GenericAttribute::CheckLocked() } } -char* SALOMEDS_GenericAttribute::Type() +std::string SALOMEDS_GenericAttribute::Type() { - TCollection_AsciiString aType; + std::string aType; if(_isLocal) { - aType = _local_impl->Type(); + aType = _local_impl->Type().ToCString(); } else { aType = _corba_impl->Type(); } - return aType.ToCString(); + return aType; } -char* SALOMEDS_GenericAttribute::GetClassType() +std::string SALOMEDS_GenericAttribute::GetClassType() { - TCollection_AsciiString aType; + std::string aType; if(_isLocal) { - aType = _local_impl->GetClassType(); + aType = _local_impl->GetClassType().ToCString(); } else { aType = _corba_impl->GetClassType(); } - return aType.ToCString(); + return aType; } SALOMEDSClient_SObject* SALOMEDS_GenericAttribute::GetSObject() @@ -107,7 +108,7 @@ SALOMEDSClient_SObject* SALOMEDS_GenericAttribute::GetSObject() SALOMEDS_GenericAttribute* SALOMEDS_GenericAttribute::CreateAttribute(const Handle(SALOMEDSImpl_GenericAttribute)& theGA) { SALOMEDS_GenericAttribute* aGA = NULL; - char* aTypeOfAttribute = theGA->GetClassType().ToCString(); + std::string aTypeOfAttribute = theGA->GetClassType().ToCString(); __CreateGenericClientAttributeLocal return aGA; } @@ -115,7 +116,7 @@ SALOMEDS_GenericAttribute* SALOMEDS_GenericAttribute::CreateAttribute(const Hand SALOMEDS_GenericAttribute* SALOMEDS_GenericAttribute::CreateAttribute(SALOMEDS::GenericAttribute_ptr theGA) { SALOMEDS_GenericAttribute* aGA = NULL; - char* aTypeOfAttribute = theGA->GetClassType(); + std::string aTypeOfAttribute = theGA->GetClassType(); __CreateGenericClientAttributeCORBA return aGA; } diff --git a/src/SALOMEDS/SALOMEDS_GenericAttribute.hxx b/src/SALOMEDS/SALOMEDS_GenericAttribute.hxx index fe6f49fb1..e47218fc3 100644 --- a/src/SALOMEDS/SALOMEDS_GenericAttribute.hxx +++ b/src/SALOMEDS/SALOMEDS_GenericAttribute.hxx @@ -28,8 +28,8 @@ public: virtual ~SALOMEDS_GenericAttribute(); void CheckLocked(); - char* Type(); - char* GetClassType(); + std::string Type(); + std::string GetClassType(); SALOMEDSClient_SObject* GetSObject(); static SALOMEDS_GenericAttribute* CreateAttribute(const Handle(SALOMEDSImpl_GenericAttribute)& theGA); diff --git a/src/SALOMEDS/SALOMEDS_SComponent.cxx b/src/SALOMEDS/SALOMEDS_SComponent.cxx index 8aebb91c6..6d51a3ba5 100644 --- a/src/SALOMEDS/SALOMEDS_SComponent.cxx +++ b/src/SALOMEDS/SALOMEDS_SComponent.cxx @@ -5,6 +5,8 @@ using namespace std; #include "SALOMEDS_SComponent.hxx" +#include +#include SALOMEDS_SComponent::SALOMEDS_SComponent(SALOMEDS::SComponent_ptr theSComponent) :SALOMEDS_SObject(theSComponent) @@ -17,18 +19,18 @@ SALOMEDS_SComponent::SALOMEDS_SComponent(const Handle(SALOMEDSImpl_SComponent)& SALOMEDS_SComponent::~SALOMEDS_SComponent() {} -char* SALOMEDS_SComponent::ComponentDataType() +std::string SALOMEDS_SComponent::ComponentDataType() { - TCollection_AsciiString aType; + std::string aType; if(_isLocal) { - aType = (Handle(SALOMEDSImpl_SComponent)::DownCast(GetLocalImpl()))->ComponentDataType(); + aType = (Handle(SALOMEDSImpl_SComponent)::DownCast(GetLocalImpl()))->ComponentDataType().ToCString(); } else aType = (SALOMEDS::SComponent::_narrow(GetCORBAImpl()))->ComponentDataType(); - return aType.ToCString(); + return aType; } -bool SALOMEDS_SComponent::ComponentIOR(char* theID) +bool SALOMEDS_SComponent::ComponentIOR(std::string& theID) { bool ret; if(_isLocal) { @@ -37,7 +39,10 @@ bool SALOMEDS_SComponent::ComponentIOR(char* theID) theID = anIOR.ToCString(); } else { - ret = (SALOMEDS::SComponent::_narrow(GetCORBAImpl()))->ComponentIOR(theID); + CORBA::String_var anIOR; + ret = (SALOMEDS::SComponent::_narrow(GetCORBAImpl()))->ComponentIOR(anIOR.out()); + theID = std::string(anIOR.in()); + } return ret; diff --git a/src/SALOMEDS/SALOMEDS_SComponent.hxx b/src/SALOMEDS/SALOMEDS_SComponent.hxx index ca1cf8402..cfd57e2b0 100644 --- a/src/SALOMEDS/SALOMEDS_SComponent.hxx +++ b/src/SALOMEDS/SALOMEDS_SComponent.hxx @@ -21,7 +21,7 @@ public: SALOMEDS_SComponent(SALOMEDS::SComponent_ptr theSComponent); ~SALOMEDS_SComponent(); - virtual char* ComponentDataType(); - virtual bool ComponentIOR(char* theID); + virtual std::string ComponentDataType(); + virtual bool ComponentIOR(std::string& theID); }; #endif diff --git a/src/SALOMEDS/SALOMEDS_SObject.cxx b/src/SALOMEDS/SALOMEDS_SObject.cxx index 81109cbe5..8768e1fb8 100644 --- a/src/SALOMEDS/SALOMEDS_SObject.cxx +++ b/src/SALOMEDS/SALOMEDS_SObject.cxx @@ -4,7 +4,8 @@ using namespace std; -#include +#include +#include #include #include "SALOMEDS_SObject.hxx" @@ -55,12 +56,12 @@ SALOMEDS_SObject::~SALOMEDS_SObject() if(!_isLocal) CORBA::release(_corba_impl); } -char* SALOMEDS_SObject::GetID() +std::string SALOMEDS_SObject::GetID() { - TCollection_AsciiString aValue; - if(_isLocal) aValue = _local_impl->GetID(); + std::string aValue; + if(_isLocal) aValue = _local_impl->GetID().ToCString(); else aValue = _corba_impl->GetID(); - return aValue.ToCString(); + return aValue; } SALOMEDSClient_SComponent* SALOMEDS_SObject::GetFatherComponent() @@ -76,18 +77,17 @@ SALOMEDSClient_SObject* SALOMEDS_SObject::GetFather() return new SALOMEDS_SObject(_corba_impl->GetFather()); } -bool SALOMEDS_SObject::FindAttribute(SALOMEDSClient_GenericAttribute*& anAttribute, const char* aTypeOfAttribute) +bool SALOMEDS_SObject::FindAttribute(SALOMEDSClient_GenericAttribute*& anAttribute, const std::string& aTypeOfAttribute) { bool ret = false; - TCollection_AsciiString aType((char*)aTypeOfAttribute); if(_isLocal) { Handle(SALOMEDSImpl_GenericAttribute) anAttr; - ret = _local_impl->FindAttribute(anAttr, aType); + ret = _local_impl->FindAttribute(anAttr, (char*)aTypeOfAttribute.c_str()); if(ret) anAttribute = SALOMEDS_GenericAttribute::CreateAttribute(anAttr); } else { SALOMEDS::GenericAttribute_var anAttr; - ret = _corba_impl->FindAttribute(anAttr.out(), aType.ToCString()); + ret = _corba_impl->FindAttribute(anAttr.out(), aTypeOfAttribute.c_str()); if(ret) anAttribute = SALOMEDS_GenericAttribute::CreateAttribute(anAttr); } @@ -135,20 +135,19 @@ SALOMEDSClient_Study* SALOMEDS_SObject::GetStudy() return new SALOMEDS_Study(_corba_impl->GetStudy()); } -char* SALOMEDS_SObject::Name() +std::string SALOMEDS_SObject::Name() { - TCollection_AsciiString aName; - if(_isLocal) aName = _local_impl->Name(); + std::string aName; + if(_isLocal) aName = _local_impl->Name().ToCString(); else aName = _corba_impl->Name(); - return aName.ToCString(); + return aName; } -void SALOMEDS_SObject::Name(const char* theName) +void SALOMEDS_SObject::Name(const std::string& theName) { - TCollection_AsciiString aName((char*)theName); - if(_isLocal) _local_impl->Name(aName); - else _corba_impl->Name(aName.ToCString()); + if(_isLocal) _local_impl->Name((char*)theName.c_str()); + else _corba_impl->Name(theName.c_str()); } vector SALOMEDS_SObject::GetAllAttributes() @@ -177,31 +176,31 @@ vector SALOMEDS_SObject::GetAllAttributes() return aVector; } -char* SALOMEDS_SObject::GetName() +std::string SALOMEDS_SObject::GetName() { - TCollection_AsciiString aName; - if(_isLocal) aName = _local_impl->GetName(); + std::string aName; + if(_isLocal) aName = _local_impl->GetName().ToCString(); else aName = _corba_impl->GetName(); - return aName.ToCString(); + return aName; } -char* SALOMEDS_SObject::GetComment() +std::string SALOMEDS_SObject::GetComment() { - TCollection_AsciiString aComment; - if(_isLocal) aComment = _local_impl->GetComment(); + std::string aComment; + if(_isLocal) aComment = _local_impl->GetComment().ToCString(); else aComment = _corba_impl->GetComment(); - return aComment.ToCString(); + return aComment; } -char* SALOMEDS_SObject::GetIOR() +std::string SALOMEDS_SObject::GetIOR() { - TCollection_AsciiString anIOR; - if(_isLocal) anIOR = _local_impl->GetIOR(); + std::string anIOR; + if(_isLocal) anIOR = _local_impl->GetIOR().ToCString(); else anIOR = _corba_impl->GetIOR(); - return anIOR.ToCString(); + return anIOR; } int SALOMEDS_SObject::Tag() @@ -220,9 +219,9 @@ CORBA::Object_ptr SALOMEDS_SObject::GetObject() { CORBA::Object_var obj; if(_isLocal) { - TCollection_AsciiString anIOR = GetIOR(); + std::string anIOR = GetIOR(); SALOMEDS_Study* aStudy = dynamic_cast(GetStudy()); - obj = CORBA::Object::_duplicate(aStudy->ConvertIORToObject(anIOR.ToCString())); + obj = CORBA::Object::_duplicate(aStudy->ConvertIORToObject(anIOR)); delete aStudy; } else obj = CORBA::Object::_duplicate(_corba_impl->GetObject()); diff --git a/src/SALOMEDS/SALOMEDS_SObject.hxx b/src/SALOMEDS/SALOMEDS_SObject.hxx index 11cff215b..5cfb7497c 100644 --- a/src/SALOMEDS/SALOMEDS_SObject.hxx +++ b/src/SALOMEDS/SALOMEDS_SObject.hxx @@ -33,19 +33,19 @@ public: SALOMEDS_SObject(const Handle(SALOMEDSImpl_SObject)& theSObject); virtual ~SALOMEDS_SObject(); - virtual char* GetID(); + virtual std::string GetID(); virtual SALOMEDSClient_SComponent* GetFatherComponent(); virtual SALOMEDSClient_SObject* GetFather(); - virtual bool FindAttribute(SALOMEDSClient_GenericAttribute*& anAttribute, const char* aTypeOfAttribute); + virtual bool FindAttribute(SALOMEDSClient_GenericAttribute*& anAttribute, const std::string& aTypeOfAttribute); virtual bool ReferencedObject(SALOMEDSClient_SObject*& theObject); virtual bool FindSubObject(int theTag, SALOMEDSClient_SObject*& theObject); virtual SALOMEDSClient_Study* GetStudy(); - virtual char* Name(); - virtual void Name(const char* theName); + virtual std::string Name(); + virtual void Name(const std::string& theName); virtual vector GetAllAttributes(); - virtual char* GetName(); - virtual char* GetComment(); - virtual char* GetIOR(); + virtual std::string GetName(); + virtual std::string GetComment(); + virtual std::string GetIOR(); virtual int Tag(); virtual int Depth(); diff --git a/src/SALOMEDS/SALOMEDS_Study.cxx b/src/SALOMEDS/SALOMEDS_Study.cxx index 1dd63654b..f4a1fe61d 100644 --- a/src/SALOMEDS/SALOMEDS_Study.cxx +++ b/src/SALOMEDS/SALOMEDS_Study.cxx @@ -24,6 +24,7 @@ using namespace std; #include "SALOMEDS_Driver_i.hxx" +#include #include #include @@ -73,20 +74,20 @@ SALOMEDS_Study::~SALOMEDS_Study() if(!_isLocal) CORBA::release(_corba_impl); } -char* SALOMEDS_Study::GetPersistentReference() +std::string SALOMEDS_Study::GetPersistentReference() { - TCollection_AsciiString aRef; - if(_isLocal) aRef = _local_impl->GetPersistentReference(); + std::string aRef; + if(_isLocal) aRef = _local_impl->GetPersistentReference().ToCString(); else aRef = _corba_impl->GetPersistentReference(); - return aRef.ToCString(); + return aRef; } -char* SALOMEDS_Study::GetTransientReference() +std::string SALOMEDS_Study::GetTransientReference() { - TCollection_AsciiString aRef; - if(_isLocal) aRef = _local_impl->GetTransientReference(); + std::string aRef; + if(_isLocal) aRef = _local_impl->GetTransientReference().ToCString(); else aRef = _corba_impl->GetTransientReference(); - return aRef.ToCString(); + return aRef; } bool SALOMEDS_Study::IsEmpty() @@ -97,34 +98,32 @@ bool SALOMEDS_Study::IsEmpty() return ret; } -SALOMEDSClient_SComponent* SALOMEDS_Study::FindComponent (const char* aComponentName) +SALOMEDSClient_SComponent* SALOMEDS_Study::FindComponent (const std::string& aComponentName) { SALOMEDS_SComponent* aSCO = NULL; - TCollection_AsciiString aName((char*)aComponentName); if(_isLocal) { - Handle(SALOMEDSImpl_SComponent) aSCO_impl =_local_impl->FindComponent(aName); + Handle(SALOMEDSImpl_SComponent) aSCO_impl =_local_impl->FindComponent((char*)aComponentName.c_str()); if(aSCO_impl.IsNull()) return NULL; aSCO = new SALOMEDS_SComponent(aSCO_impl); } else { - SALOMEDS::SComponent_var aSCO_impl = _corba_impl->FindComponent(aName.ToCString()); + SALOMEDS::SComponent_var aSCO_impl = _corba_impl->FindComponent((char*)aComponentName.c_str()); if(CORBA::is_nil(aSCO_impl)) return NULL; aSCO = new SALOMEDS_SComponent(aSCO_impl); } return aSCO; } -SALOMEDSClient_SComponent* SALOMEDS_Study::FindComponentID(const char* aComponentID) +SALOMEDSClient_SComponent* SALOMEDS_Study::FindComponentID(const std::string& aComponentID) { SALOMEDS_SComponent* aSCO = NULL; - TCollection_AsciiString anID((char*)aComponentID); if(_isLocal) { - Handle(SALOMEDSImpl_SComponent) aSCO_impl =_local_impl->FindComponentID(anID); + Handle(SALOMEDSImpl_SComponent) aSCO_impl =_local_impl->FindComponentID((char*)aComponentID.c_str()); if(aSCO_impl.IsNull()) return NULL; aSCO = new SALOMEDS_SComponent(aSCO_impl); } else { - SALOMEDS::SComponent_var aSCO_impl = _corba_impl->FindComponentID(anID.ToCString()); + SALOMEDS::SComponent_var aSCO_impl = _corba_impl->FindComponentID((char*)aComponentID.c_str()); if(CORBA::is_nil(aSCO_impl)) return NULL; aSCO = new SALOMEDS_SComponent(aSCO_impl); } @@ -132,39 +131,36 @@ SALOMEDSClient_SComponent* SALOMEDS_Study::FindComponentID(const char* aComponen } -SALOMEDSClient_SObject* SALOMEDS_Study::FindObject(const char* anObjectName) +SALOMEDSClient_SObject* SALOMEDS_Study::FindObject(const std::string& anObjectName) { SALOMEDS_SObject* aSO = NULL; - TCollection_AsciiString aName((char*)anObjectName); if(_isLocal) { - Handle(SALOMEDSImpl_SObject) aSO_impl = _local_impl->FindObject(aName); + Handle(SALOMEDSImpl_SObject) aSO_impl = _local_impl->FindObject((char*)anObjectName.c_str()); if(aSO_impl.IsNull()) return NULL; aSO = new SALOMEDS_SObject(aSO_impl); } else { - SALOMEDS::SObject_var aSO_impl = _corba_impl->FindObject(aName.ToCString()); + SALOMEDS::SObject_var aSO_impl = _corba_impl->FindObject((char*)anObjectName.c_str()); if(CORBA::is_nil(aSO_impl)) return NULL; aSO = new SALOMEDS_SObject(aSO_impl); } return aSO; } -std::vector SALOMEDS_Study::FindObjectByName(const char* anObjectName, - const char* aComponentName) +std::vector SALOMEDS_Study::FindObjectByName(const std::string& anObjectName, + const std::string& aComponentName) { std::vector aVector; int i, aLength = 0; - TCollection_AsciiString anObjName((char*)anObjectName); - TCollection_AsciiString aCompName((char*)aComponentName); if(_isLocal) { - Handle(TColStd_HSequenceOfTransient) aSeq = _local_impl->FindObjectByName(anObjName, aCompName); + Handle(TColStd_HSequenceOfTransient) aSeq = _local_impl->FindObjectByName((char*)anObjectName.c_str(), (char*)aComponentName.c_str()); aLength = aSeq->Length(); for(i = 1; i<= aLength; i++) aVector.push_back(new SALOMEDS_SObject(Handle(SALOMEDSImpl_SObject)::DownCast(aSeq->Value(i)))); } else { - SALOMEDS::Study::ListOfSObject_var aSeq = _corba_impl->FindObjectByName(anObjName.ToCString(), aCompName.ToCString()); + SALOMEDS::Study::ListOfSObject_var aSeq = _corba_impl->FindObjectByName((char*)anObjectName.c_str(), (char*)aComponentName.c_str()); aLength = aSeq->length(); for(i = 0; i< aLength; i++) aVector.push_back(new SALOMEDS_SObject(aSeq[i])); } @@ -172,159 +168,150 @@ std::vector SALOMEDS_Study::FindObjectByName(const char return aVector; } -SALOMEDSClient_SObject* SALOMEDS_Study::FindObjectID(const char* anObjectID) +SALOMEDSClient_SObject* SALOMEDS_Study::FindObjectID(const std::string& anObjectID) { SALOMEDS_SObject* aSO = NULL; - TCollection_AsciiString anID((char*)anObjectID); if(_isLocal) { - Handle(SALOMEDSImpl_SObject) aSO_impl = _local_impl->FindObjectID(anID); + Handle(SALOMEDSImpl_SObject) aSO_impl = _local_impl->FindObjectID((char*)anObjectID.c_str()); if(aSO_impl.IsNull()) return NULL; aSO = new SALOMEDS_SObject(aSO_impl); } else { - SALOMEDS::SObject_var aSO_impl = _corba_impl->FindObjectID(anID.ToCString()); + SALOMEDS::SObject_var aSO_impl = _corba_impl->FindObjectID((char*)anObjectID.c_str()); if(CORBA::is_nil(aSO_impl)) return NULL; aSO = new SALOMEDS_SObject(aSO_impl); } return aSO; } -SALOMEDSClient_SObject* SALOMEDS_Study::CreateObjectID(const char* anObjectID) +SALOMEDSClient_SObject* SALOMEDS_Study::CreateObjectID(const std::string& anObjectID) { SALOMEDS_SObject* aSO = NULL; - TCollection_AsciiString anID((char*)anObjectID); - if(_isLocal) aSO = new SALOMEDS_SObject(_local_impl->CreateObjectID(anID)); - else aSO = new SALOMEDS_SObject(_corba_impl->CreateObjectID(anID.ToCString())); + if(_isLocal) aSO = new SALOMEDS_SObject(_local_impl->CreateObjectID((char*)anObjectID.c_str())); + else aSO = new SALOMEDS_SObject(_corba_impl->CreateObjectID((char*)anObjectID.c_str())); return aSO; } -SALOMEDSClient_SObject* SALOMEDS_Study::FindObjectIOR(const char* anObjectIOR) +SALOMEDSClient_SObject* SALOMEDS_Study::FindObjectIOR(const std::string& anObjectIOR) { SALOMEDS_SObject* aSO = NULL; - TCollection_AsciiString anIOR((char*)anObjectIOR); if(_isLocal) { - Handle(SALOMEDSImpl_SObject) aSO_impl = _local_impl->FindObjectIOR(anIOR); + Handle(SALOMEDSImpl_SObject) aSO_impl = _local_impl->FindObjectIOR((char*)anObjectIOR.c_str()); if(aSO_impl.IsNull()) return NULL; aSO = new SALOMEDS_SObject(aSO_impl); } else { - SALOMEDS::SObject_var aSO_impl = _corba_impl->FindObjectIOR(anIOR.ToCString()); + SALOMEDS::SObject_var aSO_impl = _corba_impl->FindObjectIOR((char*)anObjectIOR.c_str()); if(CORBA::is_nil(aSO_impl)) return NULL; aSO = new SALOMEDS_SObject(aSO_impl); } return aSO; } -SALOMEDSClient_SObject* SALOMEDS_Study::FindObjectByPath(const char* thePath) +SALOMEDSClient_SObject* SALOMEDS_Study::FindObjectByPath(const std::string& thePath) { SALOMEDS_SObject* aSO = NULL; - TCollection_AsciiString aPath((char*)thePath); if(_isLocal) { - Handle(SALOMEDSImpl_SObject) aSO_impl = _local_impl->FindObjectByPath(aPath); + Handle(SALOMEDSImpl_SObject) aSO_impl = _local_impl->FindObjectByPath((char*)thePath.c_str()); if(aSO_impl.IsNull()) return NULL; aSO = new SALOMEDS_SObject(aSO_impl); } else { - SALOMEDS::SObject_var aSO_impl = _corba_impl->FindObjectByPath(aPath.ToCString()); + SALOMEDS::SObject_var aSO_impl = _corba_impl->FindObjectByPath((char*)thePath.c_str()); if(CORBA::is_nil(aSO_impl)) return NULL; aSO = new SALOMEDS_SObject(aSO_impl); } return aSO; } -char* SALOMEDS_Study::GetObjectPath(SALOMEDSClient_SObject* theSO) +std::string SALOMEDS_Study::GetObjectPath(SALOMEDSClient_SObject* theSO) { SALOMEDS_SObject* aSO = dynamic_cast(theSO); - TCollection_AsciiString aPath; - if(_isLocal) aPath = _local_impl->GetObjectPath(aSO->GetLocalImpl()); + std::string aPath; + if(_isLocal) aPath = _local_impl->GetObjectPath(aSO->GetLocalImpl()).ToCString(); else aPath = _corba_impl->GetObjectPath(aSO->GetCORBAImpl()); - return aPath.ToCString(); + return aPath; } -void SALOMEDS_Study::SetContext(const char* thePath) +void SALOMEDS_Study::SetContext(const std::string& thePath) { - TCollection_AsciiString aPath((char*)thePath); - if(_isLocal) _local_impl->SetContext(aPath); - else _corba_impl->SetContext(aPath.ToCString()); + if(_isLocal) _local_impl->SetContext((char*)thePath.c_str()); + else _corba_impl->SetContext((char*)thePath.c_str()); } -char* SALOMEDS_Study::GetContext() +std::string SALOMEDS_Study::GetContext() { - TCollection_AsciiString aPath; - if(_isLocal) aPath = _local_impl->GetContext(); + std::string aPath; + if(_isLocal) aPath = _local_impl->GetContext().ToCString(); else aPath = _corba_impl->GetContext(); - return aPath.ToCString(); + return aPath; } -std::vector SALOMEDS_Study::GetObjectNames(const char* theContext) +std::vector SALOMEDS_Study::GetObjectNames(const std::string& theContext) { std::vector aVector; - TCollection_AsciiString aContext((char*)theContext); int aLength, i; if(_isLocal) { - Handle(TColStd_HSequenceOfAsciiString) aSeq = _local_impl->GetObjectNames(aContext); + Handle(TColStd_HSequenceOfAsciiString) aSeq = _local_impl->GetObjectNames((char*)theContext.c_str()); aLength = aSeq->Length(); for(i = 1; i<=aLength; i++) aVector.push_back(aSeq->Value(i).ToCString()); } else { - SALOMEDS::ListOfStrings_var aSeq = _corba_impl->GetObjectNames(aContext.ToCString()); + SALOMEDS::ListOfStrings_var aSeq = _corba_impl->GetObjectNames((char*)theContext.c_str()); aLength = aSeq->length(); - for(i = 0; i SALOMEDS_Study::GetDirectoryNames(const char* theContext) +std::vector SALOMEDS_Study::GetDirectoryNames(const std::string& theContext) { std::vector aVector; - TCollection_AsciiString aContext((char*)theContext); int aLength, i; if(_isLocal) { - Handle(TColStd_HSequenceOfAsciiString) aSeq = _local_impl->GetDirectoryNames(aContext); + Handle(TColStd_HSequenceOfAsciiString) aSeq = _local_impl->GetDirectoryNames((char*)theContext.c_str()); aLength = aSeq->Length(); for(i = 1; i<=aLength; i++) aVector.push_back(aSeq->Value(i).ToCString()); } else { - SALOMEDS::ListOfStrings_var aSeq = _corba_impl->GetDirectoryNames(aContext.ToCString()); + SALOMEDS::ListOfStrings_var aSeq = _corba_impl->GetDirectoryNames((char*)theContext.c_str()); aLength = aSeq->length(); - for(i = 0; i SALOMEDS_Study::GetFileNames(const char* theContext) +std::vector SALOMEDS_Study::GetFileNames(const std::string& theContext) { std::vector aVector; - TCollection_AsciiString aContext((char*)theContext); int aLength, i; if(_isLocal) { - Handle(TColStd_HSequenceOfAsciiString) aSeq = _local_impl->GetFileNames(aContext); + Handle(TColStd_HSequenceOfAsciiString) aSeq = _local_impl->GetFileNames((char*)theContext.c_str()); aLength = aSeq->Length(); for(i = 1; i<=aLength; i++) aVector.push_back(aSeq->Value(i).ToCString()); } else { - SALOMEDS::ListOfStrings_var aSeq = _corba_impl->GetFileNames(aContext.ToCString()); + SALOMEDS::ListOfStrings_var aSeq = _corba_impl->GetFileNames((char*)theContext.c_str()); aLength = aSeq->length(); - for(i = 0; i SALOMEDS_Study::GetComponentNames(const char* theContext) +std::vector SALOMEDS_Study::GetComponentNames(const std::string& theContext) { std::vector aVector; - TCollection_AsciiString aContext((char*)theContext); int aLength, i; if(_isLocal) { - Handle(TColStd_HSequenceOfAsciiString) aSeq = _local_impl->GetComponentNames(aContext); + Handle(TColStd_HSequenceOfAsciiString) aSeq = _local_impl->GetComponentNames((char*)theContext.c_str()); aLength = aSeq->Length(); for(i = 1; i<=aLength; i++) aVector.push_back(aSeq->Value(i).ToCString()); } else { - SALOMEDS::ListOfStrings_var aSeq = _corba_impl->GetComponentNames(aContext.ToCString()); + SALOMEDS::ListOfStrings_var aSeq = _corba_impl->GetComponentNames((char*)theContext.c_str()); aLength = aSeq->length(); - for(i = 0; iName(); + std::string aName; + if(_isLocal) aName = _local_impl->Name().ToCString(); else aName = _corba_impl->Name(); - return aName.ToCString(); + return aName; } -void SALOMEDS_Study::Name(const char* name) +void SALOMEDS_Study::Name(const std::string& theName) { - TCollection_AsciiString aName((char*)name); - if(_isLocal) _local_impl->Name(aName); - else _corba_impl->Name(aName.ToCString()); + if(_isLocal) _local_impl->Name((char*)theName.c_str()); + else _corba_impl->Name((char*)theName.c_str()); } bool SALOMEDS_Study::IsSaved() @@ -412,19 +398,18 @@ bool SALOMEDS_Study::IsModified() return isModified; } -char* SALOMEDS_Study::URL() +std::string SALOMEDS_Study::URL() { - TCollection_AsciiString aURL; - if(_isLocal) aURL = _local_impl->URL(); + std::string aURL; + if(_isLocal) aURL = _local_impl->URL().ToCString(); else aURL = _corba_impl->URL(); - return aURL.ToCString(); + return aURL; } -void SALOMEDS_Study::URL(const char* url) +void SALOMEDS_Study::URL(const std::string& url) { - TCollection_AsciiString aURL((char*)url); - if(_isLocal) _local_impl->URL(aURL); - else _corba_impl->URL(aURL.ToCString()); + if(_isLocal) _local_impl->URL((char*)url.c_str()); + else _corba_impl->URL((char*)url.c_str()); } int SALOMEDS_Study::StudyId() @@ -468,12 +453,12 @@ SALOMEDSClient_AttributeStudyProperties* SALOMEDS_Study::GetProperties() return aProp; } -char* SALOMEDS_Study::GetLastModificationDate() +std::string SALOMEDS_Study::GetLastModificationDate() { - TCollection_AsciiString aDate; - if(_isLocal) aDate = _local_impl->GetLastModificationDate(); + std::string aDate; + if(_isLocal) aDate = _local_impl->GetLastModificationDate().ToCString(); else aDate = _corba_impl->GetLastModificationDate(); - return aDate.ToCString(); + return aDate; } std::vector SALOMEDS_Study::GetModificationsDate() @@ -488,7 +473,7 @@ std::vector SALOMEDS_Study::GetModificationsDate() else { SALOMEDS::ListOfDates_var aSeq = _corba_impl->GetModificationsDate(); aLength = aSeq->length(); - for(i=0; iEnableUseCaseAutoFilling(isEnabled); } -bool SALOMEDS_Study::DumpStudy(const char* thePath, const char* theBaseName, bool isPublished) +bool SALOMEDS_Study::DumpStudy(const std::string& thePath, const std::string& theBaseName, bool isPublished) { - TCollection_AsciiString aPath((char*)thePath); - TCollection_AsciiString aBaseName((char*)theBaseName); bool ret; if(_isLocal) { SALOMEDS_DriverFactory_i* aFactory = new SALOMEDS_DriverFactory_i(_orb); - ret = _local_impl->DumpStudy(aPath, aBaseName, isPublished, aFactory); + ret = _local_impl->DumpStudy((char*)thePath.c_str(), (char*)theBaseName.c_str(), isPublished, aFactory); delete aFactory; } - else ret = _corba_impl->DumpStudy(aPath.ToCString(), aBaseName.ToCString(), isPublished); + else ret = _corba_impl->DumpStudy((char*)thePath.c_str(), (char*)theBaseName.c_str(), isPublished); return ret; } -char* SALOMEDS_Study::ConvertObjectToIOR(CORBA::Object_ptr theObject) +std::string SALOMEDS_Study::ConvertObjectToIOR(CORBA::Object_ptr theObject) { return _orb->object_to_string(theObject); } -CORBA::Object_ptr SALOMEDS_Study::ConvertIORToObject(const char* theIOR) +CORBA::Object_ptr SALOMEDS_Study::ConvertIORToObject(const std::string& theIOR) { - return _orb->string_to_object(theIOR); + return _orb->string_to_object(theIOR.c_str()); } void SALOMEDS_Study::init_orb() diff --git a/src/SALOMEDS/SALOMEDS_Study.hxx b/src/SALOMEDS/SALOMEDS_Study.hxx index 1d0933f88..68f390ad7 100644 --- a/src/SALOMEDS/SALOMEDS_Study.hxx +++ b/src/SALOMEDS/SALOMEDS_Study.hxx @@ -38,47 +38,47 @@ public: SALOMEDS_Study(SALOMEDS::Study_ptr theStudy); ~SALOMEDS_Study(); - virtual char* GetPersistentReference(); - virtual char* GetTransientReference(); + virtual std::string GetPersistentReference(); + virtual std::string GetTransientReference(); virtual bool IsEmpty(); - virtual SALOMEDSClient_SComponent* FindComponent (const char* aComponentName); - virtual SALOMEDSClient_SComponent* FindComponentID(const char* aComponentID); - virtual SALOMEDSClient_SObject* FindObject(const char* anObjectName); - virtual std::vector FindObjectByName( const char* anObjectName, const char* aComponentName ) ; - virtual SALOMEDSClient_SObject* FindObjectID(const char* anObjectID); - virtual SALOMEDSClient_SObject* CreateObjectID(const char* anObjectID); - virtual SALOMEDSClient_SObject* FindObjectIOR(const char* anObjectIOR); - virtual SALOMEDSClient_SObject* FindObjectByPath(const char* thePath); - virtual char* GetObjectPath(SALOMEDSClient_SObject* theSO); - virtual void SetContext(const char* thePath); - virtual char* GetContext(); - virtual std::vector GetObjectNames(const char* theContext); - virtual std::vector GetDirectoryNames(const char* theContext); - virtual std::vector GetFileNames(const char* theContext); - virtual std::vector GetComponentNames(const char* theContext); + virtual SALOMEDSClient_SComponent* FindComponent (const std::string& aComponentName); + virtual SALOMEDSClient_SComponent* FindComponentID(const std::string& aComponentID); + virtual SALOMEDSClient_SObject* FindObject(const std::string& anObjectName); + virtual std::vector FindObjectByName( const std::string& anObjectName, const std::string& aComponentName ) ; + virtual SALOMEDSClient_SObject* FindObjectID(const std::string& anObjectID); + virtual SALOMEDSClient_SObject* CreateObjectID(const std::string& anObjectID); + virtual SALOMEDSClient_SObject* FindObjectIOR(const std::string& anObjectIOR); + virtual SALOMEDSClient_SObject* FindObjectByPath(const std::string& thePath); + virtual std::string GetObjectPath(SALOMEDSClient_SObject* theSO); + virtual void SetContext(const std::string& thePath); + virtual std::string GetContext(); + virtual std::vector GetObjectNames(const std::string& theContext); + virtual std::vector GetDirectoryNames(const std::string& theContext); + virtual std::vector GetFileNames(const std::string& theContext); + virtual std::vector GetComponentNames(const std::string& theContext); virtual SALOMEDSClient_ChildIterator* NewChildIterator(SALOMEDSClient_SObject* theSO); virtual SALOMEDSClient_SComponentIterator* NewComponentIterator(); virtual SALOMEDSClient_StudyBuilder* NewBuilder(); - virtual char* Name(); - virtual void Name(const char* name); + virtual std::string Name(); + virtual void Name(const std::string& name); virtual bool IsSaved(); virtual void IsSaved(bool save); virtual bool IsModified(); - virtual char* URL(); - virtual void URL(const char* url); + virtual std::string URL(); + virtual void URL(const std::string& url); virtual int StudyId(); virtual void StudyId(int id); virtual std::vector FindDependances(SALOMEDSClient_SObject* theSO); virtual SALOMEDSClient_AttributeStudyProperties* GetProperties(); - virtual char* GetLastModificationDate(); + virtual std::string GetLastModificationDate(); virtual std::vector GetModificationsDate(); virtual SALOMEDSClient_UseCaseBuilder* GetUseCaseBuilder(); virtual void Close(); virtual void EnableUseCaseAutoFilling(bool isEnabled); - virtual bool DumpStudy(const char* thePath, const char* theBaseName, bool isPublished); + virtual bool DumpStudy(const std::string& thePath, const std::string& theBaseName, bool isPublished); - char* ConvertObjectToIOR(CORBA::Object_ptr theObject); - CORBA::Object_ptr ConvertIORToObject(const char* theIOR); + std::string ConvertObjectToIOR(CORBA::Object_ptr theObject); + CORBA::Object_ptr ConvertIORToObject(const std::string& theIOR); private: void init_orb(); diff --git a/src/SALOMEDS/SALOMEDS_StudyBuilder.cxx b/src/SALOMEDS/SALOMEDS_StudyBuilder.cxx index e41799232..ea3afa7f1 100644 --- a/src/SALOMEDS/SALOMEDS_StudyBuilder.cxx +++ b/src/SALOMEDS/SALOMEDS_StudyBuilder.cxx @@ -14,7 +14,8 @@ using namespace std; #include "SALOMEDS_Driver_i.hxx" #include "SALOMEDS_GenericAttribute.hxx" #include "SALOMEDSImpl_GenericAttribute.hxx" -#include +#include +#include #include #include "SALOMEDS_StudyManager.hxx" @@ -43,20 +44,19 @@ SALOMEDS_StudyBuilder::~SALOMEDS_StudyBuilder() if(!_isLocal) CORBA::release(_corba_impl); } -SALOMEDSClient_SComponent* SALOMEDS_StudyBuilder::NewComponent(const char* ComponentDataType) +SALOMEDSClient_SComponent* SALOMEDS_StudyBuilder::NewComponent(const std::string& ComponentDataType) { CheckLocked(); SALOMEDS_SComponent* aSCO = NULL; - TCollection_AsciiString aType((char*)ComponentDataType); if(_isLocal) { - Handle(SALOMEDSImpl_SComponent) aSCO_impl =_local_impl->NewComponent(aType); + Handle(SALOMEDSImpl_SComponent) aSCO_impl =_local_impl->NewComponent((char*)ComponentDataType.c_str()); if(aSCO_impl.IsNull()) return NULL; aSCO = new SALOMEDS_SComponent(aSCO_impl); } else { - SALOMEDS::SComponent_var aSCO_impl = _corba_impl->NewComponent(aType.ToCString()); + SALOMEDS::SComponent_var aSCO_impl = _corba_impl->NewComponent((char*)ComponentDataType.c_str()); if(CORBA::is_nil(aSCO_impl)) return NULL; aSCO = new SALOMEDS_SComponent(aSCO_impl); } @@ -65,15 +65,15 @@ SALOMEDSClient_SComponent* SALOMEDS_StudyBuilder::NewComponent(const char* Compo } void SALOMEDS_StudyBuilder::DefineComponentInstance (SALOMEDSClient_SComponent* theSCO, - const char* ComponentIOR) + const std::string& ComponentIOR) { CheckLocked(); SALOMEDS_SComponent* aSCO = dynamic_cast(theSCO); - TCollection_AsciiString anIOR((char*)ComponentIOR); - if(_isLocal) _local_impl->DefineComponentInstance(Handle(SALOMEDSImpl_SComponent)::DownCast(aSCO->GetLocalImpl()),anIOR); + if(_isLocal) _local_impl->DefineComponentInstance(Handle(SALOMEDSImpl_SComponent)::DownCast(aSCO->GetLocalImpl()), + (char*)ComponentIOR.c_str()); else { - CORBA::Object_var obj = _orb->string_to_object(ComponentIOR); + CORBA::Object_var obj = _orb->string_to_object(ComponentIOR.c_str()); _corba_impl->DefineComponentInstance(SALOMEDS::SComponent::_narrow(aSCO->GetCORBAImpl()), obj); } } @@ -130,28 +130,26 @@ SALOMEDSClient_SObject* SALOMEDS_StudyBuilder::NewObjectToTag(SALOMEDSClient_SOb } -void SALOMEDS_StudyBuilder::AddDirectory(const char* thePath) +void SALOMEDS_StudyBuilder::AddDirectory(const std::string& thePath) { CheckLocked(); - TCollection_AsciiString aPath((char*)thePath); if(_isLocal) { - _local_impl->AddDirectory(aPath); - if(!_local_impl->AddDirectory(TCollection_AsciiString((char*)thePath))) { - TCollection_AsciiString anErrorCode = _local_impl->GetErrorCode(); + _local_impl->AddDirectory((char*)thePath.c_str()); + if(_local_impl->IsError()) { + std::string anErrorCode = _local_impl->GetErrorCode().ToCString(); if(anErrorCode == "StudyNameAlreadyUsed") throw SALOMEDS::Study::StudyNameAlreadyUsed(); if(anErrorCode == "StudyInvalidDirectory") throw SALOMEDS::Study::StudyInvalidDirectory(); if(anErrorCode == "StudyInvalidComponent") throw SALOMEDS::Study::StudyInvalidComponent(); } } - else _corba_impl->AddDirectory(aPath.ToCString()); + else _corba_impl->AddDirectory((char*)thePath.c_str()); } -void SALOMEDS_StudyBuilder::LoadWith(SALOMEDSClient_SComponent* theSCO, const char* theIOR) +void SALOMEDS_StudyBuilder::LoadWith(SALOMEDSClient_SComponent* theSCO, const std::string& theIOR) { SALOMEDS_SComponent* aSCO = dynamic_cast(theSCO); - TCollection_AsciiString anIOR((char*)theIOR); - CORBA::Object_var obj = _orb->string_to_object(theIOR); + CORBA::Object_var obj = _orb->string_to_object(theIOR.c_str()); SALOMEDS::Driver_var aDriver = SALOMEDS::Driver::_narrow(obj); if(_isLocal) { @@ -192,15 +190,15 @@ void SALOMEDS_StudyBuilder::RemoveObjectWithChildren(SALOMEDSClient_SObject* the } SALOMEDSClient_GenericAttribute* SALOMEDS_StudyBuilder::FindOrCreateAttribute(SALOMEDSClient_SObject* theSO, - const char* aTypeOfAttribute) + const std::string& aTypeOfAttribute) { SALOMEDS_SObject* aSO = dynamic_cast(theSO); SALOMEDS_GenericAttribute* anAttr = NULL; - TCollection_AsciiString aType((char*)aTypeOfAttribute); if(_isLocal) { Handle(SALOMEDSImpl_GenericAttribute) aGA; try { - aGA=Handle(SALOMEDSImpl_GenericAttribute)::DownCast(_local_impl->FindOrCreateAttribute(aSO->GetLocalImpl(),aType)); + aGA=Handle(SALOMEDSImpl_GenericAttribute)::DownCast(_local_impl->FindOrCreateAttribute(aSO->GetLocalImpl(), + (char*)aTypeOfAttribute.c_str())); } catch (...) { throw SALOMEDS::StudyBuilder::LockProtection(); @@ -208,7 +206,7 @@ SALOMEDSClient_GenericAttribute* SALOMEDS_StudyBuilder::FindOrCreateAttribute(SA anAttr = SALOMEDS_GenericAttribute::CreateAttribute(aGA); } else { - SALOMEDS::GenericAttribute_var aGA = _corba_impl->FindOrCreateAttribute(aSO->GetCORBAImpl(), aType.ToCString()); + SALOMEDS::GenericAttribute_var aGA = _corba_impl->FindOrCreateAttribute(aSO->GetCORBAImpl(), (char*)aTypeOfAttribute.c_str()); anAttr = SALOMEDS_GenericAttribute::CreateAttribute(aGA); } @@ -217,34 +215,32 @@ SALOMEDSClient_GenericAttribute* SALOMEDS_StudyBuilder::FindOrCreateAttribute(SA bool SALOMEDS_StudyBuilder::FindAttribute(SALOMEDSClient_SObject* theSO, SALOMEDSClient_GenericAttribute* anAttribute, - const char* aTypeOfAttribute) + const std::string& aTypeOfAttribute) { bool ret; SALOMEDS_SObject* aSO = dynamic_cast(theSO); - TCollection_AsciiString aType((char*)aTypeOfAttribute); anAttribute = NULL; if(_isLocal) { Handle(SALOMEDSImpl_GenericAttribute) aGA; - ret = _local_impl->FindAttribute(aSO->GetLocalImpl(), aGA, aType); + ret = _local_impl->FindAttribute(aSO->GetLocalImpl(), aGA, (char*)aTypeOfAttribute.c_str()); if(ret) anAttribute = SALOMEDS_GenericAttribute::CreateAttribute(aGA); } else { SALOMEDS::GenericAttribute_var aGA; - ret = _corba_impl->FindAttribute(aSO->GetCORBAImpl(), aGA.out(), aType.ToCString()); + ret = _corba_impl->FindAttribute(aSO->GetCORBAImpl(), aGA.out(), (char*)aTypeOfAttribute.c_str()); if(ret) anAttribute = SALOMEDS_GenericAttribute::CreateAttribute(aGA); } return ret; } -void SALOMEDS_StudyBuilder::RemoveAttribute(SALOMEDSClient_SObject* theSO, const char* aTypeOfAttribute) +void SALOMEDS_StudyBuilder::RemoveAttribute(SALOMEDSClient_SObject* theSO, const std::string& aTypeOfAttribute) { CheckLocked(); SALOMEDS_SObject* aSO = dynamic_cast(theSO); - TCollection_AsciiString aType((char*)aTypeOfAttribute); - if(_isLocal) _local_impl->RemoveAttribute(aSO->GetLocalImpl(), aType); - else _corba_impl->RemoveAttribute(aSO->GetCORBAImpl(), aType.ToCString()); + if(_isLocal) _local_impl->RemoveAttribute(aSO->GetLocalImpl(), (char*)aTypeOfAttribute.c_str()); + else _corba_impl->RemoveAttribute(aSO->GetCORBAImpl(), (char*)aTypeOfAttribute.c_str()); } void SALOMEDS_StudyBuilder::Addreference(SALOMEDSClient_SObject* me, SALOMEDSClient_SObject* thereferencedObject) @@ -266,23 +262,21 @@ void SALOMEDS_StudyBuilder::RemoveReference(SALOMEDSClient_SObject* me) else _corba_impl->RemoveReference(aSO->GetCORBAImpl()); } -void SALOMEDS_StudyBuilder::SetGUID(SALOMEDSClient_SObject* theSO, const char* theGUID) +void SALOMEDS_StudyBuilder::SetGUID(SALOMEDSClient_SObject* theSO, const std::string& theGUID) { CheckLocked(); SALOMEDS_SObject* aSO = dynamic_cast(theSO); - TCollection_AsciiString aGUID((char*)theGUID); - if(_isLocal) _local_impl->SetGUID(aSO->GetLocalImpl(), aGUID); - else _corba_impl->SetGUID(aSO->GetCORBAImpl(), aGUID.ToCString()); + if(_isLocal) _local_impl->SetGUID(aSO->GetLocalImpl(), (char*)theGUID.c_str()); + else _corba_impl->SetGUID(aSO->GetCORBAImpl(), (char*)theGUID.c_str()); } -bool SALOMEDS_StudyBuilder::IsGUID(SALOMEDSClient_SObject* theSO, const char* theGUID) +bool SALOMEDS_StudyBuilder::IsGUID(SALOMEDSClient_SObject* theSO, const std::string& theGUID) { SALOMEDS_SObject* aSO = dynamic_cast(theSO); - TCollection_AsciiString aGUID((char*)theGUID); bool ret; - if(_isLocal) ret = _local_impl->IsGUID(aSO->GetLocalImpl(), aGUID); - else ret = _corba_impl->IsGUID(aSO->GetCORBAImpl(), aGUID.ToCString()); + if(_isLocal) ret = _local_impl->IsGUID(aSO->GetLocalImpl(), (char*)theGUID.c_str()); + else ret = _corba_impl->IsGUID(aSO->GetCORBAImpl(), (char*)theGUID.c_str()); return ret; } @@ -391,34 +385,31 @@ void SALOMEDS_StudyBuilder::CheckLocked() } } -void SALOMEDS_StudyBuilder::SetName(SALOMEDSClient_SObject* theSO, const char* theValue) +void SALOMEDS_StudyBuilder::SetName(SALOMEDSClient_SObject* theSO, const std::string& theValue) { CheckLocked(); SALOMEDS_SObject* aSO = dynamic_cast(theSO); - TCollection_AsciiString aValue((char*)theValue); - if(_isLocal) _local_impl->SetName(aSO->GetLocalImpl(), aValue); - else _corba_impl->SetName(aSO->GetCORBAImpl(), aValue.ToCString()); + if(_isLocal) _local_impl->SetName(aSO->GetLocalImpl(), (char*)theValue.c_str()); + else _corba_impl->SetName(aSO->GetCORBAImpl(), (char*)theValue.c_str()); } -void SALOMEDS_StudyBuilder::SetComment(SALOMEDSClient_SObject* theSO, const char* theValue) +void SALOMEDS_StudyBuilder::SetComment(SALOMEDSClient_SObject* theSO, const std::string& theValue) { CheckLocked(); SALOMEDS_SObject* aSO = dynamic_cast(theSO); - TCollection_AsciiString aValue((char*)theValue); - if(_isLocal) _local_impl->SetComment(aSO->GetLocalImpl(), aValue); - else _corba_impl->SetComment(aSO->GetCORBAImpl(), aValue.ToCString()); + if(_isLocal) _local_impl->SetComment(aSO->GetLocalImpl(), (char*)theValue.c_str()); + else _corba_impl->SetComment(aSO->GetCORBAImpl(), (char*)theValue.c_str()); } -void SALOMEDS_StudyBuilder::SetIOR(SALOMEDSClient_SObject* theSO, const char* theValue) +void SALOMEDS_StudyBuilder::SetIOR(SALOMEDSClient_SObject* theSO, const std::string& theValue) { CheckLocked(); SALOMEDS_SObject* aSO = dynamic_cast(theSO); - TCollection_AsciiString aValue((char*)theValue); - if(_isLocal) _local_impl->SetIOR(aSO->GetLocalImpl(), aValue); - else _corba_impl->SetIOR(aSO->GetCORBAImpl(), aValue.ToCString()); + if(_isLocal) _local_impl->SetIOR(aSO->GetLocalImpl(), (char*)theValue.c_str()); + else _corba_impl->SetIOR(aSO->GetCORBAImpl(), (char*)theValue.c_str()); } void SALOMEDS_StudyBuilder::init_orb() diff --git a/src/SALOMEDS/SALOMEDS_StudyBuilder.hxx b/src/SALOMEDS/SALOMEDS_StudyBuilder.hxx index b97e085b6..0302c1268 100644 --- a/src/SALOMEDS/SALOMEDS_StudyBuilder.hxx +++ b/src/SALOMEDS/SALOMEDS_StudyBuilder.hxx @@ -30,26 +30,26 @@ public: SALOMEDS_StudyBuilder(SALOMEDS::StudyBuilder_ptr theBuilder); ~SALOMEDS_StudyBuilder(); - virtual SALOMEDSClient_SComponent* NewComponent(const char* ComponentDataType); - virtual void DefineComponentInstance (SALOMEDSClient_SComponent*, const char* ComponentIOR); + virtual SALOMEDSClient_SComponent* NewComponent(const std::string& ComponentDataType); + virtual void DefineComponentInstance (SALOMEDSClient_SComponent*, const std::string& ComponentIOR); virtual void RemoveComponent(SALOMEDSClient_SComponent* theSCO); virtual SALOMEDSClient_SObject* NewObject(SALOMEDSClient_SObject* theFatherObject); virtual SALOMEDSClient_SObject* NewObjectToTag(SALOMEDSClient_SObject* theFatherObject, int theTag); - virtual void AddDirectory(const char* thePath); - virtual void LoadWith(SALOMEDSClient_SComponent* theSCO, const char* theIOR); + virtual void AddDirectory(const std::string& thePath); + virtual void LoadWith(SALOMEDSClient_SComponent* theSCO, const std::string& theIOR); virtual void Load(SALOMEDSClient_SObject* theSCO); virtual void RemoveObject(SALOMEDSClient_SObject* theSO); virtual void RemoveObjectWithChildren(SALOMEDSClient_SObject* theSO); virtual SALOMEDSClient_GenericAttribute* FindOrCreateAttribute(SALOMEDSClient_SObject* theSO, - const char* aTypeOfAttribute); + const std::string& aTypeOfAttribute); virtual bool FindAttribute(SALOMEDSClient_SObject* theSO, SALOMEDSClient_GenericAttribute* theAttribute, - const char* aTypeOfAttribute); - virtual void RemoveAttribute(SALOMEDSClient_SObject* theSO, const char* aTypeOfAttribute); + const std::string& aTypeOfAttribute); + virtual void RemoveAttribute(SALOMEDSClient_SObject* theSO, const std::string& aTypeOfAttribute); virtual void Addreference(SALOMEDSClient_SObject* me, SALOMEDSClient_SObject* thereferencedObject); virtual void RemoveReference(SALOMEDSClient_SObject* me); - virtual void SetGUID(SALOMEDSClient_SObject* theSO, const char* theGUID); - virtual bool IsGUID(SALOMEDSClient_SObject* theSO, const char* theGUID); + virtual void SetGUID(SALOMEDSClient_SObject* theSO, const std::string& theGUID); + virtual bool IsGUID(SALOMEDSClient_SObject* theSO, const std::string& theGUID); virtual void NewCommand(); virtual void CommitCommand(); virtual bool HasOpenCommand(); @@ -60,9 +60,9 @@ public: virtual bool GetAvailableRedos(); virtual int UndoLimit(); virtual void UndoLimit(int theLimit); - virtual void SetName(SALOMEDSClient_SObject* theSO, const char* theValue); - virtual void SetComment(SALOMEDSClient_SObject* theSO, const char* theValue); - virtual void SetIOR(SALOMEDSClient_SObject* theSO, const char* theValue); + virtual void SetName(SALOMEDSClient_SObject* theSO, const std::string& theValue); + virtual void SetComment(SALOMEDSClient_SObject* theSO, const std::string& theValue); + virtual void SetIOR(SALOMEDSClient_SObject* theSO, const std::string& theValue); private: void CheckLocked(); diff --git a/src/SALOMEDS/SALOMEDS_StudyManager.cxx b/src/SALOMEDS/SALOMEDS_StudyManager.cxx index ada635c30..80e6a2e81 100644 --- a/src/SALOMEDS/SALOMEDS_StudyManager.cxx +++ b/src/SALOMEDS/SALOMEDS_StudyManager.cxx @@ -20,7 +20,8 @@ using namespace std; #include #endif -#include +#include +#include #include #include "OpUtil.hxx" @@ -54,18 +55,17 @@ SALOMEDS_StudyManager::~SALOMEDS_StudyManager() if(!_isLocal) CORBA::release(_corba_impl); } -SALOMEDSClient_Study* SALOMEDS_StudyManager::NewStudy(const char* study_name) +SALOMEDSClient_Study* SALOMEDS_StudyManager::NewStudy(const std::string& study_name) { SALOMEDS_Study* aStudy; - TCollection_AsciiString aName((char*)study_name); if(_isLocal) { - Handle(SALOMEDSImpl_Study) aStudy_impl = _local_impl->NewStudy(aName); + Handle(SALOMEDSImpl_Study) aStudy_impl = _local_impl->NewStudy((char*)study_name.c_str()); if(aStudy_impl.IsNull()) return NULL; aStudy = new SALOMEDS_Study(aStudy_impl); } else { - SALOMEDS::Study_var aStudy_impl = _corba_impl->NewStudy(aName.ToCString()); + SALOMEDS::Study_var aStudy_impl = _corba_impl->NewStudy((char*)study_name.c_str()); if(CORBA::is_nil(aStudy_impl)) return NULL; aStudy = new SALOMEDS_Study(aStudy_impl); } @@ -73,18 +73,17 @@ SALOMEDSClient_Study* SALOMEDS_StudyManager::NewStudy(const char* study_name) return aStudy; } -SALOMEDSClient_Study* SALOMEDS_StudyManager::Open(const char* theStudyUrl) +SALOMEDSClient_Study* SALOMEDS_StudyManager::Open(const std::string& theStudyUrl) { SALOMEDS_Study* aStudy; - TCollection_AsciiString aName((char*)theStudyUrl); if(_isLocal) { - Handle(SALOMEDSImpl_Study) aStudy_impl = _local_impl->Open(aName); + Handle(SALOMEDSImpl_Study) aStudy_impl = _local_impl->Open((char*)theStudyUrl.c_str()); if(aStudy_impl.IsNull()) return NULL; aStudy = new SALOMEDS_Study(aStudy_impl); } else { - SALOMEDS::Study_var aStudy_impl = _corba_impl->Open(aName.ToCString()); + SALOMEDS::Study_var aStudy_impl = _corba_impl->Open((char*)theStudyUrl.c_str()); if(CORBA::is_nil(aStudy_impl)) return NULL; aStudy = new SALOMEDS_Study(aStudy_impl); } @@ -113,20 +112,18 @@ void SALOMEDS_StudyManager::SaveASCII( SALOMEDSClient_Study* theStudy, bool theM _corba_impl->SaveASCII(aStudy, theMultiFile); } -void SALOMEDS_StudyManager::SaveAs(const char* theUrl, SALOMEDSClient_Study* theStudy, bool theMultiFile) +void SALOMEDS_StudyManager::SaveAs(const std::string& theUrl, SALOMEDSClient_Study* theStudy, bool theMultiFile) { //SRN: Pure CORBA save as the save operation require CORBA in any case - TCollection_AsciiString anURL((char*)theUrl); SALOMEDS::Study_var aStudy = _corba_impl->GetStudyByID(theStudy->StudyId()); - _corba_impl->SaveAs(anURL.ToCString(), aStudy, theMultiFile); + _corba_impl->SaveAs((char*)theUrl.c_str(), aStudy, theMultiFile); } -void SALOMEDS_StudyManager::SaveAsASCII(const char* theUrl, SALOMEDSClient_Study* theStudy, bool theMultiFile) +void SALOMEDS_StudyManager::SaveAsASCII(const std::string& theUrl, SALOMEDSClient_Study* theStudy, bool theMultiFile) { //SRN: Pure CORBA save as the save operation require CORBA in any case - TCollection_AsciiString anURL((char*)theUrl); SALOMEDS::Study_var aStudy = _corba_impl->GetStudyByID(theStudy->StudyId()); - _corba_impl->SaveAsASCII(anURL.ToCString(), aStudy, theMultiFile); + _corba_impl->SaveAsASCII((char*)theUrl.c_str(), aStudy, theMultiFile); } std::vector SALOMEDS_StudyManager::GetOpenStudies() @@ -149,17 +146,16 @@ std::vector SALOMEDS_StudyManager::GetOpenStudies() return aVector; } -SALOMEDSClient_Study* SALOMEDS_StudyManager::GetStudyByName(const char* theStudyName) +SALOMEDSClient_Study* SALOMEDS_StudyManager::GetStudyByName(const std::string& theStudyName) { SALOMEDS_Study* aStudy = NULL; - TCollection_AsciiString aName((char*)theStudyName); if(_isLocal) { - Handle(SALOMEDSImpl_Study) aStudy_impl = _local_impl->GetStudyByName(aName); + Handle(SALOMEDSImpl_Study) aStudy_impl = _local_impl->GetStudyByName((char*)theStudyName.c_str()); if(aStudy_impl.IsNull()) return NULL; aStudy = new SALOMEDS_Study(aStudy_impl); } else { - SALOMEDS::Study_var aStudy_impl = _corba_impl->GetStudyByName(aName.ToCString()); + SALOMEDS::Study_var aStudy_impl = _corba_impl->GetStudyByName((char*)theStudyName.c_str()); if(CORBA::is_nil(aStudy_impl)) return NULL; aStudy = new SALOMEDS_Study(aStudy_impl); } diff --git a/src/SALOMEDS/SALOMEDS_StudyManager.hxx b/src/SALOMEDS/SALOMEDS_StudyManager.hxx index 908aa2b2c..73d7adfb1 100644 --- a/src/SALOMEDS/SALOMEDS_StudyManager.hxx +++ b/src/SALOMEDS/SALOMEDS_StudyManager.hxx @@ -30,15 +30,15 @@ public: SALOMEDS_StudyManager(SALOMEDS::StudyManager_ptr theManager); ~SALOMEDS_StudyManager(); - virtual SALOMEDSClient_Study* NewStudy(const char* study_name); - virtual SALOMEDSClient_Study* Open(const char* theStudyUrl); + virtual SALOMEDSClient_Study* NewStudy(const std::string& study_name); + virtual SALOMEDSClient_Study* Open(const std::string& theStudyUrl); virtual void Close( SALOMEDSClient_Study* theStudy); virtual void Save( SALOMEDSClient_Study* theStudy, bool theMultiFile); virtual void SaveASCII( SALOMEDSClient_Study* theStudy, bool theMultiFile); - virtual void SaveAs(const char* theUrl, SALOMEDSClient_Study* theStudy, bool theMultiFile); - virtual void SaveAsASCII(const char* theUrl, SALOMEDSClient_Study* theStudy, bool theMultiFile); + virtual void SaveAs(const std::string& theUrl, SALOMEDSClient_Study* theStudy, bool theMultiFile); + virtual void SaveAsASCII(const std::string& theUrl, SALOMEDSClient_Study* theStudy, bool theMultiFile); virtual std::vector GetOpenStudies(); - virtual SALOMEDSClient_Study* GetStudyByName(const char* theStudyName) ; + virtual SALOMEDSClient_Study* GetStudyByName(const std::string& theStudyName) ; virtual SALOMEDSClient_Study* GetStudyByID(int theStudyID) ; virtual bool CanCopy(SALOMEDSClient_SObject* theSO); virtual bool Copy(SALOMEDSClient_SObject* theSO); diff --git a/src/SALOMEDS/SALOMEDS_UseCaseBuilder.cxx b/src/SALOMEDS/SALOMEDS_UseCaseBuilder.cxx index 1ec301640..aaef1c6b4 100644 --- a/src/SALOMEDS/SALOMEDS_UseCaseBuilder.cxx +++ b/src/SALOMEDS/SALOMEDS_UseCaseBuilder.cxx @@ -10,7 +10,8 @@ using namespace std; #include "SALOMEDS_SObject.hxx" #include "SALOMEDSImpl_UseCaseIterator.hxx" #include "SALOMEDS_UseCaseIterator.hxx" -#include +#include +#include SALOMEDS_UseCaseBuilder::SALOMEDS_UseCaseBuilder(const Handle(SALOMEDSImpl_UseCaseBuilder)& theBuilder) { @@ -104,12 +105,11 @@ bool SALOMEDS_UseCaseBuilder::IsUseCase(SALOMEDSClient_SObject* theObject) return ret; } -bool SALOMEDS_UseCaseBuilder::SetName(const char* theName) +bool SALOMEDS_UseCaseBuilder::SetName(const std::string& theName) { bool ret; - TCollection_AsciiString aName((char*)theName); - if(_isLocal) ret = _local_impl->SetName(aName); - else ret = _corba_impl->SetName(aName.ToCString()); + if(_isLocal) ret = _local_impl->SetName((char*)theName.c_str()); + else ret = _corba_impl->SetName((char*)theName.c_str()); return ret; } @@ -121,20 +121,19 @@ SALOMEDSClient_SObject* SALOMEDS_UseCaseBuilder::GetCurrentObject() return obj; } -char* SALOMEDS_UseCaseBuilder::GetName() +std::string SALOMEDS_UseCaseBuilder::GetName() { - TCollection_AsciiString aName; - if(_isLocal) aName = _local_impl->GetName(); + std::string aName; + if(_isLocal) aName = _local_impl->GetName().ToCString(); else aName = _corba_impl->GetName(); - return aName.ToCString(); + return aName; } -SALOMEDSClient_SObject* SALOMEDS_UseCaseBuilder::AddUseCase(const char* theName) +SALOMEDSClient_SObject* SALOMEDS_UseCaseBuilder::AddUseCase(const std::string& theName) { SALOMEDS_SObject* obj = NULL; - TCollection_AsciiString aName((char*)theName); - if(_isLocal) obj = new SALOMEDS_SObject(_local_impl->AddUseCase(aName)); - else obj = new SALOMEDS_SObject(_corba_impl->AddUseCase(aName.ToCString())); + if(_isLocal) obj = new SALOMEDS_SObject(_local_impl->AddUseCase((char*)theName.c_str())); + else obj = new SALOMEDS_SObject(_corba_impl->AddUseCase((char*)theName.c_str())); return obj; } diff --git a/src/SALOMEDS/SALOMEDS_UseCaseBuilder.hxx b/src/SALOMEDS/SALOMEDS_UseCaseBuilder.hxx index 125869013..9d7eabb55 100644 --- a/src/SALOMEDS/SALOMEDS_UseCaseBuilder.hxx +++ b/src/SALOMEDS/SALOMEDS_UseCaseBuilder.hxx @@ -36,10 +36,10 @@ public: virtual bool SetRootCurrent(); virtual bool HasChildren(SALOMEDSClient_SObject* theObject); virtual bool IsUseCase(SALOMEDSClient_SObject* theObject); - virtual bool SetName(const char* theName); + virtual bool SetName(const std::string& theName); virtual SALOMEDSClient_SObject* GetCurrentObject(); - virtual char* GetName(); - virtual SALOMEDSClient_SObject* AddUseCase(const char* theName); + virtual std::string GetName(); + virtual SALOMEDSClient_SObject* AddUseCase(const std::string& theName); virtual SALOMEDSClient_UseCaseIterator* GetUseCaseIterator(SALOMEDSClient_SObject* anObject); }; diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeComment.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeComment.hxx index 54a3e7c8c..12f31a6fb 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeComment.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeComment.hxx @@ -6,12 +6,13 @@ #define SALOMEDSClient_AttributeComment_HeaderFile #include "SALOMEDSClient_GenericAttribute.hxx" +#include class SALOMEDSClient_AttributeComment: public virtual SALOMEDSClient_GenericAttribute { public: - virtual char* Value() = 0; - virtual void SetValue(const char* value) = 0; + virtual std::string Value() = 0; + virtual void SetValue(const std::string& value) = 0; }; #endif diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeExternalFileDef.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeExternalFileDef.hxx index fb4fff25b..556e0090a 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeExternalFileDef.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeExternalFileDef.hxx @@ -6,12 +6,13 @@ #define SALOMEDSClient_AttributeExternalFileDef_HeaderFile #include "SALOMEDSClient_GenericAttribute.hxx" +#include class SALOMEDSClient_AttributeExternalFileDef: public virtual SALOMEDSClient_GenericAttribute { public: - virtual char* Value() = 0; - virtual void SetValue(const char* value) = 0; + virtual std::string Value() = 0; + virtual void SetValue(const std::string& value) = 0; }; diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeFileType.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeFileType.hxx index 0b534d8f0..0091fdce5 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeFileType.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeFileType.hxx @@ -6,12 +6,13 @@ #define SALOMEDSClient_AttributeFileType_HeaderFile #include "SALOMEDSClient_GenericAttribute.hxx" +#include class SALOMEDSClient_AttributeFileType: public virtual SALOMEDSClient_GenericAttribute { public: - virtual char* Value() = 0; - virtual void SetValue(const char* value) = 0; + virtual std::string Value() = 0; + virtual void SetValue(const std::string& value) = 0; }; diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeIOR.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeIOR.hxx index 93fa61b2f..fbf652334 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeIOR.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeIOR.hxx @@ -6,13 +6,14 @@ #define SALOMEDSClient_AttributeIOR_HeaderFile #include "SALOMEDSClient_GenericAttribute.hxx" +#include class SALOMEDSClient_AttributeIOR: public virtual SALOMEDSClient_GenericAttribute { public: - virtual char* Value() = 0; - virtual void SetValue(const char* value) = 0; + virtual std::string Value() = 0; + virtual void SetValue(const std::string& value) = 0; }; diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeName.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeName.hxx index 63fa39046..0195617ff 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeName.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeName.hxx @@ -7,13 +7,14 @@ #define SALOMEDSClient_AttributeName_HeaderFile #include "SALOMEDSClient_GenericAttribute.hxx" +#include class SALOMEDSClient_AttributeName: public virtual SALOMEDSClient_GenericAttribute { public: - virtual char* Value() = 0; - virtual void SetValue(const char* value) = 0; + virtual std::string Value() = 0; + virtual void SetValue(const std::string& value) = 0; }; diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributePersistentRef.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributePersistentRef.hxx index 931f0d967..c4fb218a8 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributePersistentRef.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributePersistentRef.hxx @@ -6,13 +6,14 @@ #define SALOMEDSClient_AttributePersistentRef_HeaderFile #include "SALOMEDSClient_GenericAttribute.hxx" +#include class SALOMEDSClient_AttributePersistentRef: public virtual SALOMEDSClient_GenericAttribute { public: - virtual char* Value() = 0; - virtual void SetValue(const char* value) = 0; + virtual std::string Value() = 0; + virtual void SetValue(const std::string& value) = 0; }; diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributePixMap.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributePixMap.hxx index de9b3b43c..dfb9718e6 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributePixMap.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributePixMap.hxx @@ -6,14 +6,15 @@ #define SALOMEDSClient_AttributePixMap_HeaderFile #include "SALOMEDSClient_GenericAttribute.hxx" +#include class SALOMEDSClient_AttributePixMap: public virtual SALOMEDSClient_GenericAttribute { public: virtual bool HasPixMap() = 0; - virtual char* GetPixMap() = 0; - virtual void SetPixMap(const char* value) = 0; + virtual std::string GetPixMap() = 0; + virtual void SetPixMap(const std::string& value) = 0; }; diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributePythonObject.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributePythonObject.hxx index d1b37001f..de067d3eb 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributePythonObject.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributePythonObject.hxx @@ -6,13 +6,14 @@ #define SALOMEDSClient_AttributePythonObject_HeaderFile #include "SALOMEDSClient_GenericAttribute.hxx" +#include class SALOMEDSClient_AttributePythonObject: public virtual SALOMEDSClient_GenericAttribute { public: - virtual void SetObject(const char* theSequence, bool IsScript) = 0; - virtual char* GetObject() = 0; + virtual void SetObject(const std::string& theSequence, bool IsScript) = 0; + virtual std::string GetObject() = 0; virtual bool IsScript() = 0; }; diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeStudyProperties.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeStudyProperties.hxx index 8e408219b..ed76b8cba 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeStudyProperties.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeStudyProperties.hxx @@ -14,18 +14,18 @@ class SALOMEDSClient_AttributeStudyProperties: public virtual SALOMEDSClient_Gen { public: - virtual void SetUserName(const char* theName) = 0; - virtual char* GetUserName() = 0; + virtual void SetUserName(const std::string& theName) = 0; + virtual std::string GetUserName() = 0; virtual void SetCreationDate(int theMinute, int theHour, int theDay, int theMonth, int theYear) = 0; virtual bool GetCreationDate(int& theMinute, int& theHour, int& theDay, int& theMonth, int& theYear) = 0; - virtual void SetCreationMode(const char* theMode) = 0; - virtual char* GetCreationMode() = 0; + virtual void SetCreationMode(const std::string& theMode) = 0; + virtual std::string GetCreationMode() = 0; virtual void SetModified(int theModified) = 0; virtual bool IsModified() = 0; virtual int GetModified() = 0; virtual void SetLocked(bool theLocked) = 0; virtual bool IsLocked() = 0; - virtual void SetModification(const char* theName, + virtual void SetModification(const std::string& theName, int theMinute, int theHour, int theDay, diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeTableOfInteger.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeTableOfInteger.hxx index 8a46b2944..f15ea6be3 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeTableOfInteger.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeTableOfInteger.hxx @@ -14,16 +14,16 @@ class SALOMEDSClient_AttributeTableOfInteger: public virtual SALOMEDSClient_Gene public: - virtual void SetTitle(const char* theTitle) = 0; - virtual char* GetTitle() = 0; - virtual void SetRowTitle(int theIndex, const char* theTitle) = 0; + virtual void SetTitle(const std::string& theTitle) = 0; + virtual std::string GetTitle() = 0; + virtual void SetRowTitle(int theIndex, const std::string& theTitle) = 0; virtual void SetRowTitles(const std::vector& theTitles) = 0; virtual std::vector GetRowTitles() = 0; - virtual void SetColumnTitle(int theIndex, const char* theTitle) = 0; + virtual void SetColumnTitle(int theIndex, const std::string& theTitle) = 0; virtual void SetColumnTitles(const std::vector& theTitles) = 0; virtual std::vector GetColumnTitles() = 0; - virtual void SetRowUnit(int theIndex, const char* theUnit) = 0; + virtual void SetRowUnit(int theIndex, const std::string& theUnit) = 0; virtual void SetRowUnits(const std::vector& theUnits) = 0; virtual std::vector GetRowUnits() = 0; diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeTableOfReal.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeTableOfReal.hxx index 3da7e8a81..774998260 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeTableOfReal.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeTableOfReal.hxx @@ -14,15 +14,15 @@ class SALOMEDSClient_AttributeTableOfReal: public virtual SALOMEDSClient_Generic public: - virtual void SetTitle(const char* theTitle) = 0; - virtual char* GetTitle() = 0; - virtual void SetRowTitle(int theIndex, const char* theTitle) = 0; + virtual void SetTitle(const std::string& theTitle) = 0; + virtual std::string GetTitle() = 0; + virtual void SetRowTitle(int theIndex, const std::string& theTitle) = 0; virtual void SetRowTitles(const std::vector& theTitles) = 0; virtual std::vector GetRowTitles() = 0; - virtual void SetColumnTitle(int theIndex, const char* theTitle) = 0; + virtual void SetColumnTitle(int theIndex, const std::string& theTitle) = 0; virtual void SetColumnTitles(const std::vector& theTitles) = 0; virtual std::vector GetColumnTitles() = 0; - virtual void SetRowUnit(int theIndex, const char* theUnit) = 0; + virtual void SetRowUnit(int theIndex, const std::string& theUnit) = 0; virtual void SetRowUnits(const std::vector& theUnits) = 0; virtual std::vector GetRowUnits() = 0; diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeTableOfString.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeTableOfString.hxx index fae6d5c2c..040e8df2c 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeTableOfString.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeTableOfString.hxx @@ -13,16 +13,16 @@ class SALOMEDSClient_AttributeTableOfString: public virtual SALOMEDSClient_Gener { public: - virtual void SetTitle(const char* theTitle) = 0; - virtual char* GetTitle() = 0; - virtual void SetRowTitle(int theIndex, const char* theTitle) = 0; + virtual void SetTitle(const std::string& theTitle) = 0; + virtual std::string GetTitle() = 0; + virtual void SetRowTitle(int theIndex, const std::string& theTitle) = 0; virtual void SetRowTitles(const std::vector& theTitles) = 0; virtual std::vector GetRowTitles() = 0; - virtual void SetColumnTitle(int theIndex, const char* theTitle) = 0; + virtual void SetColumnTitle(int theIndex, const std::string& theTitle) = 0; virtual void SetColumnTitles(const std::vector& theTitles) = 0; virtual std::vector GetColumnTitles() = 0; - virtual void SetRowUnit(int theIndex, const char* theUnit) = 0; + virtual void SetRowUnit(int theIndex, const std::string& theUnit) = 0; virtual void SetRowUnits(const std::vector& theUnits) = 0; virtual std::vector GetRowUnits() = 0; @@ -34,9 +34,9 @@ public: virtual void AddColumn(const std::vector& theData) = 0; virtual void SetColumn(int theColumn, const std::vector& theData) = 0; virtual std::vector GetColumn(int theColumn) = 0; - virtual void PutValue(const char* theValue, int theRow, int theColumn) = 0; + virtual void PutValue(const std::string& theValue, int theRow, int theColumn) = 0; virtual bool HasValue(int theRow, int theColumn) = 0; - virtual char* GetValue(int theRow, int theColumn) = 0; + virtual std::string GetValue(int theRow, int theColumn) = 0; virtual std::vector GetRowSetIndices(int theRow) = 0; virtual void SetNbColumns(int theNbColumns) = 0; diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeTreeNode.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeTreeNode.hxx index a035dd961..949f11ab7 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeTreeNode.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeTreeNode.hxx @@ -23,8 +23,8 @@ public: virtual void SetFirst(SALOMEDSClient_AttributeTreeNode* value) = 0; virtual bool HasFirst() = 0; virtual SALOMEDSClient_AttributeTreeNode* GetFirst() = 0; - virtual void SetTreeID(const char* value) = 0; - virtual char* GetTreeID() = 0; + virtual void SetTreeID(const std::string& value) = 0; + virtual std::string GetTreeID() = 0; virtual void Append(SALOMEDSClient_AttributeTreeNode* value) = 0; virtual void Prepend(SALOMEDSClient_AttributeTreeNode* value) = 0; virtual void InsertBefore(SALOMEDSClient_AttributeTreeNode* value) = 0; @@ -35,7 +35,7 @@ public: virtual bool IsDescendant(SALOMEDSClient_AttributeTreeNode* value) = 0; virtual bool IsFather(SALOMEDSClient_AttributeTreeNode* value) = 0; virtual bool IsChild(SALOMEDSClient_AttributeTreeNode* value) = 0; - virtual char* Label() = 0; + virtual std::string Label() = 0; }; diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeUserID.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeUserID.hxx index e18453849..22a5056c3 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeUserID.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeUserID.hxx @@ -6,13 +6,14 @@ #define SALOMEDSClient_AttributeUserID_HeaderFile #include "SALOMEDSClient_GenericAttribute.hxx" +#include class SALOMEDSClient_AttributeUserID: public virtual SALOMEDSClient_GenericAttribute { public: - virtual char* Value() = 0; - virtual void SetValue(const char* value) = 0; + virtual std::string Value() = 0; + virtual void SetValue(const std::string& value) = 0; }; diff --git a/src/SALOMEDSClient/SALOMEDSClient_GenericAttribute.hxx b/src/SALOMEDSClient/SALOMEDSClient_GenericAttribute.hxx index 3ea5a5bd1..467557d2a 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_GenericAttribute.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_GenericAttribute.hxx @@ -5,9 +5,8 @@ #ifndef _GENERICCLIENT_ATTRIBUTE_HXX_ #define _GENERICCLIENT_ATTRIBUTE_HXX_ -#include +#include -//SALOMEDSClient headers #include "SALOMEDSClient_SObject.hxx" class SALOMEDSClient_GenericAttribute @@ -15,8 +14,8 @@ class SALOMEDSClient_GenericAttribute public: virtual void CheckLocked() = 0; - virtual char* Type() = 0; - virtual char* GetClassType() = 0; + virtual std::string Type() = 0; + virtual std::string GetClassType() = 0; virtual SALOMEDSClient_SObject* GetSObject() = 0; }; diff --git a/src/SALOMEDSClient/SALOMEDSClient_SComponent.hxx b/src/SALOMEDSClient/SALOMEDSClient_SComponent.hxx index f5615f3b7..a1b3bc7f6 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_SComponent.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_SComponent.hxx @@ -5,15 +5,15 @@ #ifndef __SALOMEDSCLIENT_SCOMPONENT_H__ #define __SALOMEDSCLIENT_SCOMPONENT_H__ -//SALOMEDSClient headers #include "SALOMEDSClient_SObject.hxx" +#include class SALOMEDSClient_SComponent: public virtual SALOMEDSClient_SObject { public: - virtual char* ComponentDataType() = 0; - virtual bool ComponentIOR(char* theID) = 0; + virtual std::string ComponentDataType() = 0; + virtual bool ComponentIOR(std::string& theID) = 0; }; #endif diff --git a/src/SALOMEDSClient/SALOMEDSClient_SObject.hxx b/src/SALOMEDSClient/SALOMEDSClient_SObject.hxx index f6b52e1bb..4206db304 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_SObject.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_SObject.hxx @@ -7,6 +7,7 @@ // std C++ headers #include +#include class SALOMEDSClient_Study; class SALOMEDSClient_SComponent; @@ -15,19 +16,19 @@ class SALOMEDSClient_GenericAttribute; class SALOMEDSClient_SObject { public: - virtual char* GetID() = 0; + virtual std::string GetID() = 0; virtual SALOMEDSClient_SComponent* GetFatherComponent() = 0; virtual SALOMEDSClient_SObject* GetFather() = 0; - virtual bool FindAttribute(SALOMEDSClient_GenericAttribute*& anAttribute, const char* aTypeOfAttribute) = 0; + virtual bool FindAttribute(SALOMEDSClient_GenericAttribute*& anAttribute, const std::string& aTypeOfAttribute) = 0; virtual bool ReferencedObject(SALOMEDSClient_SObject*& theObject) = 0; virtual bool FindSubObject(int theTag, SALOMEDSClient_SObject*& theObject) = 0; virtual SALOMEDSClient_Study* GetStudy() = 0; - virtual char* Name() = 0; - virtual void Name(const char* theName) = 0; + virtual std::string Name() = 0; + virtual void Name(const std::string& theName) = 0; virtual std::vector GetAllAttributes() = 0; - virtual char* GetName() = 0; - virtual char* GetComment() = 0; - virtual char* GetIOR() = 0; + virtual std::string GetName() = 0; + virtual std::string GetComment() = 0; + virtual std::string GetIOR() = 0; virtual int Tag() = 0; virtual int Depth() = 0; }; diff --git a/src/SALOMEDSClient/SALOMEDSClient_Study.hxx b/src/SALOMEDSClient/SALOMEDSClient_Study.hxx index 92d68a33c..da1a55807 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_Study.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_Study.hxx @@ -21,43 +21,43 @@ class SALOMEDSClient_Study public: - virtual char* GetPersistentReference() = 0; - virtual char* GetTransientReference() = 0; + virtual std::string GetPersistentReference() = 0; + virtual std::string GetTransientReference() = 0; virtual bool IsEmpty() = 0; - virtual SALOMEDSClient_SComponent* FindComponent (const char* aComponentName) = 0; - virtual SALOMEDSClient_SComponent* FindComponentID(const char* aComponentID) = 0; - virtual SALOMEDSClient_SObject* FindObject(const char* anObjectName) = 0; - virtual std::vector FindObjectByName( const char* anObjectName, const char* aComponentName ) = 0; - virtual SALOMEDSClient_SObject* FindObjectID(const char* anObjectID) = 0; - virtual SALOMEDSClient_SObject* CreateObjectID(const char* anObjectID) = 0; - virtual SALOMEDSClient_SObject* FindObjectIOR(const char* anObjectIOR) = 0; - virtual SALOMEDSClient_SObject* FindObjectByPath(const char* thePath) = 0; - virtual char* GetObjectPath(SALOMEDSClient_SObject* theSO) = 0; - virtual void SetContext(const char* thePath) = 0; - virtual char* GetContext() = 0; - virtual std::vector GetObjectNames(const char* theContext) = 0; - virtual std::vector GetDirectoryNames(const char* theContext) = 0; - virtual std::vector GetFileNames(const char* theContext) = 0; - virtual std::vector GetComponentNames(const char* theContext) = 0; + virtual SALOMEDSClient_SComponent* FindComponent (const std::string& aComponentName) = 0; + virtual SALOMEDSClient_SComponent* FindComponentID(const std::string& aComponentID) = 0; + virtual SALOMEDSClient_SObject* FindObject(const std::string& anObjectName) = 0; + virtual std::vector FindObjectByName( const std::string& anObjectName, const std::string& aComponentName ) = 0; + virtual SALOMEDSClient_SObject* FindObjectID(const std::string& anObjectID) = 0; + virtual SALOMEDSClient_SObject* CreateObjectID(const std::string& anObjectID) = 0; + virtual SALOMEDSClient_SObject* FindObjectIOR(const std::string& anObjectIOR) = 0; + virtual SALOMEDSClient_SObject* FindObjectByPath(const std::string& thePath) = 0; + virtual std::string GetObjectPath(SALOMEDSClient_SObject* theSO) = 0; + virtual void SetContext(const std::string& thePath) = 0; + virtual std::string GetContext() = 0; + virtual std::vector GetObjectNames(const std::string& theContext) = 0; + virtual std::vector GetDirectoryNames(const std::string& theContext) = 0; + virtual std::vector GetFileNames(const std::string& theContext) = 0; + virtual std::vector GetComponentNames(const std::string& theContext) = 0; virtual SALOMEDSClient_ChildIterator* NewChildIterator(SALOMEDSClient_SObject* theSO) = 0; virtual SALOMEDSClient_SComponentIterator* NewComponentIterator() = 0; virtual SALOMEDSClient_StudyBuilder* NewBuilder() = 0; - virtual char* Name() = 0; - virtual void Name(const char* name) = 0; + virtual std::string Name() = 0; + virtual void Name(const std::string& name) = 0; virtual bool IsSaved() = 0; virtual void IsSaved(bool save) = 0; virtual bool IsModified() = 0; - virtual char* URL() = 0; - virtual void URL(const char* url) = 0; + virtual std::string URL() = 0; + virtual void URL(const std::string& url) = 0; virtual int StudyId() = 0; virtual void StudyId(int id) = 0; virtual std::vector FindDependances(SALOMEDSClient_SObject* theSO) = 0; virtual SALOMEDSClient_AttributeStudyProperties* GetProperties() = 0; - virtual char* GetLastModificationDate() = 0; + virtual std::string GetLastModificationDate() = 0; virtual std::vector GetModificationsDate() = 0; virtual SALOMEDSClient_UseCaseBuilder* GetUseCaseBuilder() = 0; virtual void Close() = 0; virtual void EnableUseCaseAutoFilling(bool isEnabled) = 0; - virtual bool DumpStudy(const char* thePath, const char* theBaseName, bool isPublished) = 0; + virtual bool DumpStudy(const std::string& thePath, const std::string& theBaseName, bool isPublished) = 0; }; #endif diff --git a/src/SALOMEDSClient/SALOMEDSClient_StudyBuilder.hxx b/src/SALOMEDSClient/SALOMEDSClient_StudyBuilder.hxx index adea93673..5741e9575 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_StudyBuilder.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_StudyBuilder.hxx @@ -8,29 +8,30 @@ #include "SALOMEDSClient_SObject.hxx" #include "SALOMEDSClient_SComponent.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" +#include class SALOMEDSClient_StudyBuilder { public: - virtual SALOMEDSClient_SComponent* NewComponent(const char* ComponentDataType) = 0; - virtual void DefineComponentInstance (SALOMEDSClient_SComponent*, const char* ComponentIOR) = 0; + virtual SALOMEDSClient_SComponent* NewComponent(const std::string& ComponentDataType) = 0; + virtual void DefineComponentInstance (SALOMEDSClient_SComponent*, const std::string& ComponentIOR) = 0; virtual void RemoveComponent(SALOMEDSClient_SComponent* theSCO) = 0; virtual SALOMEDSClient_SObject* NewObject(SALOMEDSClient_SObject* theFatherObject) = 0; virtual SALOMEDSClient_SObject* NewObjectToTag(SALOMEDSClient_SObject* theFatherObject, int theTag) = 0; - virtual void AddDirectory(const char* thePath) = 0; - virtual void LoadWith(SALOMEDSClient_SComponent* theSCO, const char* theIOR) = 0; + virtual void AddDirectory(const std::string& thePath) = 0; + virtual void LoadWith(SALOMEDSClient_SComponent* theSCO, const std::string& theIOR) = 0; virtual void Load(SALOMEDSClient_SObject* theSCO) = 0; virtual void RemoveObject(SALOMEDSClient_SObject* theSO) = 0; virtual void RemoveObjectWithChildren(SALOMEDSClient_SObject* theSO) = 0; - virtual SALOMEDSClient_GenericAttribute* FindOrCreateAttribute(SALOMEDSClient_SObject* theSO, const char* aTypeOfAttribute) = 0; + virtual SALOMEDSClient_GenericAttribute* FindOrCreateAttribute(SALOMEDSClient_SObject* theSO, const std::string& aTypeOfAttribute) = 0; virtual bool FindAttribute(SALOMEDSClient_SObject* theSO, SALOMEDSClient_GenericAttribute* theAttribute, - const char* aTypeOfAttribute) = 0; - virtual void RemoveAttribute(SALOMEDSClient_SObject* theSO, const char* aTypeOfAttribute) = 0; + const std::string& aTypeOfAttribute) = 0; + virtual void RemoveAttribute(SALOMEDSClient_SObject* theSO, const std::string& aTypeOfAttribute) = 0; virtual void Addreference(SALOMEDSClient_SObject* me, SALOMEDSClient_SObject* thereferencedObject) = 0; virtual void RemoveReference(SALOMEDSClient_SObject* me) = 0; - virtual void SetGUID(SALOMEDSClient_SObject* theSO, const char* theGUID) = 0; - virtual bool IsGUID(SALOMEDSClient_SObject* theSO, const char* theGUID) = 0; + virtual void SetGUID(SALOMEDSClient_SObject* theSO, const std::string& theGUID) = 0; + virtual bool IsGUID(SALOMEDSClient_SObject* theSO, const std::string& theGUID) = 0; virtual void NewCommand() = 0; virtual void CommitCommand()= 0; virtual bool HasOpenCommand() = 0; @@ -41,8 +42,8 @@ public: virtual bool GetAvailableRedos() = 0; virtual int UndoLimit() = 0; virtual void UndoLimit(int theLimit) = 0; - virtual void SetName(SALOMEDSClient_SObject* theSO, const char* theValue) = 0; - virtual void SetComment(SALOMEDSClient_SObject* theSO, const char* theValue) = 0; - virtual void SetIOR(SALOMEDSClient_SObject* theSO, const char* theValue) = 0; + virtual void SetName(SALOMEDSClient_SObject* theSO, const std::string& theValue) = 0; + virtual void SetComment(SALOMEDSClient_SObject* theSO, const std::string& theValue) = 0; + virtual void SetIOR(SALOMEDSClient_SObject* theSO, const std::string& theValue) = 0; }; #endif diff --git a/src/SALOMEDSClient/SALOMEDSClient_StudyManager.hxx b/src/SALOMEDSClient/SALOMEDSClient_StudyManager.hxx index 43c6fcd37..41ba8080b 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_StudyManager.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_StudyManager.hxx @@ -14,15 +14,15 @@ class SALOMEDSClient_StudyManager { public: - virtual SALOMEDSClient_Study* NewStudy(const char* study_name) = 0; - virtual SALOMEDSClient_Study* Open(const char* theStudyUrl) = 0; + virtual SALOMEDSClient_Study* NewStudy(const std::string& study_name) = 0; + virtual SALOMEDSClient_Study* Open(const std::string& theStudyUrl) = 0; virtual void Close( SALOMEDSClient_Study* theStudy) = 0; virtual void Save( SALOMEDSClient_Study* theStudy, bool theMultiFile) = 0; virtual void SaveASCII( SALOMEDSClient_Study* theStudy, bool theMultiFile) = 0; - virtual void SaveAs(const char* theUrl, SALOMEDSClient_Study* theStudy, bool theMultiFile) = 0; - virtual void SaveAsASCII(const char* theUrl, SALOMEDSClient_Study* theStudy, bool theMultiFile) = 0; + virtual void SaveAs(const std::string& theUrl, SALOMEDSClient_Study* theStudy, bool theMultiFile) = 0; + virtual void SaveAsASCII(const std::string& theUrl, SALOMEDSClient_Study* theStudy, bool theMultiFile) = 0; virtual std::vector GetOpenStudies() = 0; - virtual SALOMEDSClient_Study* GetStudyByName(const char* theStudyName) = 0; + virtual SALOMEDSClient_Study* GetStudyByName(const std::string& theStudyName) = 0; virtual SALOMEDSClient_Study* GetStudyByID(int theStudyID) = 0; virtual bool CanCopy(SALOMEDSClient_SObject* theSO) = 0; virtual bool Copy(SALOMEDSClient_SObject* theSO) = 0; diff --git a/src/SALOMEDSClient/SALOMEDSClient_UseCaseBuilder.hxx b/src/SALOMEDSClient/SALOMEDSClient_UseCaseBuilder.hxx index 08c3d1f4c..9d79cc9cb 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_UseCaseBuilder.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_UseCaseBuilder.hxx @@ -7,6 +7,7 @@ #include "SALOMEDSClient_UseCaseIterator.hxx" #include "SALOMEDSClient_SObject.hxx" +#include class SALOMEDSClient_UseCaseBuilder { @@ -20,10 +21,10 @@ public: virtual bool SetRootCurrent() = 0; virtual bool HasChildren(SALOMEDSClient_SObject* theObject) = 0; virtual bool IsUseCase(SALOMEDSClient_SObject* theObject) = 0; - virtual bool SetName(const char* theName) = 0; + virtual bool SetName(const std::string& theName) = 0; virtual SALOMEDSClient_SObject* GetCurrentObject() = 0; - virtual char* GetName() = 0; - virtual SALOMEDSClient_SObject* AddUseCase(const char* theName) = 0; + virtual std::string GetName() = 0; + virtual SALOMEDSClient_SObject* AddUseCase(const std::string& theName) = 0; virtual SALOMEDSClient_UseCaseIterator* GetUseCaseIterator(SALOMEDSClient_SObject* anObject) = 0; };