PAL10015. Add optional arg theAppend to constructor

This commit is contained in:
eap 2005-10-14 13:32:41 +00:00
parent 8405ffc0f5
commit 7a7b104ba6
2 changed files with 10 additions and 4 deletions

View File

@ -25,16 +25,21 @@ namespace GEOM
{ {
size_t TPythonDump::myCounter = 0; size_t TPythonDump::myCounter = 0;
TPythonDump::TPythonDump (Handle(GEOM_Function)& theFunction) TPythonDump::TPythonDump (Handle(GEOM_Function)& theFunction, bool theAppend)
{ {
myFunction = theFunction; myFunction = theFunction;
myCounter++; myCounter++;
myAppend = theAppend;
} }
TPythonDump::~TPythonDump() TPythonDump::~TPythonDump()
{ {
if (--myCounter == 0) { if (--myCounter == 0) {
myFunction->SetDescription((char *)myStream.str().c_str()); TCollection_AsciiString aDescr;
if ( myAppend )
aDescr = myFunction->GetDescription() + "\n\t";
aDescr += (char *)myStream.str().c_str();
myFunction->SetDescription( aDescr );
} }
} }

View File

@ -32,12 +32,13 @@ namespace GEOM
class TPythonDump class TPythonDump
{ {
std::ostringstream myStream; std::ostringstream myStream;
static size_t myCounter; static size_t myCounter;
bool myAppend;
Handle(GEOM_Function) myFunction; Handle(GEOM_Function) myFunction;
public: public:
Standard_EXPORT TPythonDump (Handle(GEOM_Function)& theFunction); Standard_EXPORT TPythonDump (Handle(GEOM_Function)& theFunction, bool theAppend=false);
Standard_EXPORT virtual ~TPythonDump(); Standard_EXPORT virtual ~TPythonDump();
// operator TCollection_AsciiString () const; // operator TCollection_AsciiString () const;