From 7a7b104ba643ba417559c77e0f0f37c2caf5950a Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 14 Oct 2005 13:32:41 +0000 Subject: [PATCH] PAL10015. Add optional arg theAppend to constructor --- src/GEOM/GEOM_PythonDump.cxx | 9 +++++++-- src/GEOM/GEOM_PythonDump.hxx | 5 +++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/GEOM/GEOM_PythonDump.cxx b/src/GEOM/GEOM_PythonDump.cxx index ee18fca2a..86c576c64 100644 --- a/src/GEOM/GEOM_PythonDump.cxx +++ b/src/GEOM/GEOM_PythonDump.cxx @@ -25,16 +25,21 @@ namespace GEOM { size_t TPythonDump::myCounter = 0; - TPythonDump::TPythonDump (Handle(GEOM_Function)& theFunction) + TPythonDump::TPythonDump (Handle(GEOM_Function)& theFunction, bool theAppend) { myFunction = theFunction; myCounter++; + myAppend = theAppend; } TPythonDump::~TPythonDump() { 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 ); } } diff --git a/src/GEOM/GEOM_PythonDump.hxx b/src/GEOM/GEOM_PythonDump.hxx index 2bac138ab..0288f4b1a 100644 --- a/src/GEOM/GEOM_PythonDump.hxx +++ b/src/GEOM/GEOM_PythonDump.hxx @@ -32,12 +32,13 @@ namespace GEOM class TPythonDump { std::ostringstream myStream; - static size_t myCounter; + static size_t myCounter; + bool myAppend; Handle(GEOM_Function) myFunction; public: - Standard_EXPORT TPythonDump (Handle(GEOM_Function)& theFunction); + Standard_EXPORT TPythonDump (Handle(GEOM_Function)& theFunction, bool theAppend=false); Standard_EXPORT virtual ~TPythonDump(); // operator TCollection_AsciiString () const; -- 2.39.2