// -------------------------------------------------------------------------
cpPlugins::Interface::Parameters::
TString cpPlugins::Interface::Parameters::
-GetString( const TString& name ) const
+GetString( const TString& name, bool force ) const
{
TParameters::const_iterator i = this->m_Parameters.find( name );
if( i != this->m_Parameters.end( ) )
{
- if( i->second.first == Self::String )
+ if( i->second.first == Self::String || !force )
return( i->second.second.second );
} // fi
if( i != this->m_Parameters.end( ) )
{
if( i->second.first == Self::Real )
- return( TReal( std::atof( i->second.second.second.c_str( ) ) ) );
+ {
+ std::istringstream tok_str( i->second.second.second );
+ float v;
+ tok_str >> v;
+ return( TReal( v ) );
+
+ } // fi
} // fi
return( TReal( 0 ) );
std::istringstream str( i->second.second.second );
std::string token;
while( std::getline( str, token, '#' ) )
- lst.push_back( TReal( std::atof( token.c_str( ) ) ) );
+ {
+ std::istringstream tok_str( token );
+ float v;
+ tok_str >> v;
+ lst.push_back( TReal( v ) );
+
+ } // elihw
}
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
void cpPlugins::Interface::Parameters::
-SetString( const TString& name, const TString& v )
+SetString( const TString& name, const TString& v, bool force )
{
TParameters::iterator i = this->m_Parameters.find( name );
if( i == this->m_Parameters.end( ) )
return;
- if( i->second.first != Self::String )
+ if( i->second.first != Self::String && force )
return;
i->second.second.second = v;
this->Modified( );