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
12 #include "SALOMEDS_AttributePythonObject_i.hxx"
13 #include <TCollection_ExtendedString.hxx>
14 #include <TColStd_HArray1OfCharacter.hxx>
18 void SALOMEDS_AttributePythonObject_i::SetObject(const char* theSequence, CORBA::Boolean IsScript) {
20 Handle(SALOMEDS_PythonObjectAttribute)::DownCast(_myAttr)->SetObject(const_cast<char*>(theSequence), IsScript);
23 char* SALOMEDS_AttributePythonObject_i::GetObject() {
24 char* aSeq = Handle(SALOMEDS_PythonObjectAttribute)::DownCast(_myAttr)->GetObject();
25 CORBA::String_var aStr = CORBA::string_dup(aSeq);
29 CORBA::Boolean SALOMEDS_AttributePythonObject_i::IsScript() {
30 return Handle(SALOMEDS_PythonObjectAttribute)::DownCast(_myAttr)->IsScript();
33 char* SALOMEDS_AttributePythonObject_i::Store() {
34 CORBA::String_var aString = GetObject();
35 char* aResult = new char[strlen(aString) + 2];
36 aResult[0] = IsScript()?'s':'n';
37 strcpy(aResult+1, aString);
41 void SALOMEDS_AttributePythonObject_i::Restore(const char* theValue) {
42 SetObject(&theValue[1], theValue[0]=='s');