+ //! change expression of the parameter
+ string GetExpression( in boolean forceConvert );
+
//! return type of parameter
ParamType GetType();
{
std::string anExpr;
if( aParam->IsCalculable() )
- anExpr = aParam->Expression();
+ anExpr = aParam->GetExpression( false );
else
anExpr = aParam->AsString();
AddSubstitution( theParamName, anExpr, false );
if( aParam->IsCalculable() )
{
aRes += "\"";
- aRes += aParam->Expression();
+ aRes += aParam->GetExpression( false );
aRes += "\"";
}
else
if( pit->second->IsAnonymous() )
aStr += "[A] ";
if( pit->second->IsCalculable() )
- aStr += pit->second->Expression() + " (val=" + pit->second->AsString() + ")";
+ aStr += std::string( pit->second->GetExpression( false ) ) + " (val=" + pit->second->AsString() + ")";
else
aStr += pit->second->AsString();
aStr += "\n";
return myIsCalculable;
}
-std::string SALOME_Parameter::Expression() const
+char* SALOME_Parameter::GetExpression( CORBA::Boolean theForceConvert )
{
- return myExpr.expression();
+ const char* aRes;
+ if( IsCalculable() )
+ aRes = myExpr.expression().c_str();
+ else
+ aRes = theForceConvert ? myResult.toString().c_str() : "";
+ return CORBA::string_dup( aRes );
}
void SALOME_Parameter::Substitute( const std::string& theName, const SALOME_EvalExpr& theExpr )
virtual CORBA::Double AsReal();
virtual CORBA::Boolean AsBoolean();
+ virtual char* GetExpression( CORBA::Boolean theForceConvert );
+
SALOME_StringList Dependencies() const;
std::string Save() const;
bool IsAnonymous() const;
bool IsCalculable() const;
- std::string Expression() const;
void Substitute( const std::string& theName, const SALOME_EvalExpr& theExpr );
private: