#include "SALOMEDS_AttributePythonObject_i.hxx"
#include <TCollection_ExtendedString.hxx>
#include <TColStd_HArray1OfCharacter.hxx>
-#include "SALOMEDS_SObject_i.hxx"
+
using namespace std;
void SALOMEDS_AttributePythonObject_i::SetObject(const char* theSequence, CORBA::Boolean IsScript) {
CheckLocked();
- char *aSeq = CORBA::string_dup(theSequence);
- Handle(SALOMEDS_PythonObjectAttribute)::DownCast(_myAttr)->SetObject(aSeq, IsScript);
+ Handle(SALOMEDS_PythonObjectAttribute)::DownCast(_myAttr)->SetObject(const_cast<char*>(theSequence), IsScript);
}
char* SALOMEDS_AttributePythonObject_i::GetObject() {
CORBA::Boolean SALOMEDS_AttributePythonObject_i::IsScript() {
return Handle(SALOMEDS_PythonObjectAttribute)::DownCast(_myAttr)->IsScript();
}
+
+char* SALOMEDS_AttributePythonObject_i::Store() {
+ CORBA::String_var aString = GetObject();
+ char* aResult = new char[strlen(aString) + 2];
+ aResult[0] = IsScript()?'s':'n';
+ strcpy(aResult+1, aString);
+ return aResult;
+}
+
+void SALOMEDS_AttributePythonObject_i::Restore(const char* theValue) {
+ SetObject(&theValue[1], theValue[0]=='s');
+}