1 // SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
3 // Copyright (C) 2003 CEA/DEN, EDF R&D
7 // File : SALOMEDS_AttributePythonObject_i.cxx
8 // Author : Michael Ponikarov
13 #include "SALOMEDS_AttributePythonObject_i.hxx"
14 #include <TCollection_ExtendedString.hxx>
15 #include <TColStd_HArray1OfCharacter.hxx>
16 #include "SALOMEDS_SObject_i.hxx"
18 void SALOMEDS_AttributePythonObject_i::SetObject(const char* theSequence, CORBA::Boolean IsScript) {
20 char *aSeq = CORBA::string_dup(theSequence);
21 Handle(SALOMEDS_PythonObjectAttribute)::DownCast(_myAttr)->SetObject(aSeq, IsScript);
24 char* SALOMEDS_AttributePythonObject_i::GetObject() {
25 char* aSeq = Handle(SALOMEDS_PythonObjectAttribute)::DownCast(_myAttr)->GetObject();
26 CORBA::String_var aStr = CORBA::string_dup(aSeq);
30 CORBA::Boolean SALOMEDS_AttributePythonObject_i::IsScript() {
31 return Handle(SALOMEDS_PythonObjectAttribute)::DownCast(_myAttr)->IsScript();
34 char* SALOMEDS_AttributePythonObject_i::Store() {
35 CORBA::String_var aString = GetObject();
36 char* aResult = new char[strlen(aString) + 2];
37 aResult[0] = IsScript()?'s':'n';
38 strcpy(aResult+1, aString);
42 void SALOMEDS_AttributePythonObject_i::Restore(const char* value) {
43 char* aString = CORBA::string_dup(value);
44 SetObject(aString + 1, aString[0]=='s');