X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FInterface%2FParameters.cxx;h=38a5f14af0b02729b9298d1290265e586cb20a51;hb=7c7bc497af96e7b5845be9a2fc277036ec752be9;hp=603aca9d421f69b15991286a37156b02ea9f4450;hpb=bd25303e6df8698b696a61975d9a1aff40c7231d;p=cpPlugins.git diff --git a/lib/cpPlugins/Interface/Parameters.cxx b/lib/cpPlugins/Interface/Parameters.cxx index 603aca9..38a5f14 100644 --- a/lib/cpPlugins/Interface/Parameters.cxx +++ b/lib/cpPlugins/Interface/Parameters.cxx @@ -350,4 +350,144 @@ GetValueAsRealList( std::vector< TReal >& lst, const TString& name ) const lst.push_back( TReal( std::atof( token.c_str( ) ) ) ); } +// ------------------------------------------------------------------------- +bool cpPlugins::Interface::Parameters:: +HasStringValue( const TString& name ) const +{ + TParameters::const_iterator pIt = this->m_Parameters.find( name ); + if( pIt != this->m_Parameters.end( ) ) + return( pIt->second.first == Self::String ); + return( false ); +} + +// ------------------------------------------------------------------------- +bool cpPlugins::Interface::Parameters:: +HasBoolValue( const TString& name ) const +{ + TParameters::const_iterator pIt = this->m_Parameters.find( name ); + if( pIt != this->m_Parameters.end( ) ) + return( pIt->second.first == Self::Bool ); + return( false ); +} + +// ------------------------------------------------------------------------- +bool cpPlugins::Interface::Parameters:: +HasIntValue( const TString& name ) const +{ + TParameters::const_iterator pIt = this->m_Parameters.find( name ); + if( pIt != this->m_Parameters.end( ) ) + return( pIt->second.first == Self::Int ); + return( false ); +} + +// ------------------------------------------------------------------------- +bool cpPlugins::Interface::Parameters:: +HasUintValue( const TString& name ) const +{ + TParameters::const_iterator pIt = this->m_Parameters.find( name ); + if( pIt != this->m_Parameters.end( ) ) + return( pIt->second.first == Self::Uint ); + return( false ); +} + +// ------------------------------------------------------------------------- +bool cpPlugins::Interface::Parameters:: +HasRealValue( const TString& name ) const +{ + TParameters::const_iterator pIt = this->m_Parameters.find( name ); + if( pIt != this->m_Parameters.end( ) ) + return( pIt->second.first == Self::Real ); + return( false ); +} + +// ------------------------------------------------------------------------- +bool cpPlugins::Interface::Parameters:: +HasIndexValue( const TString& name ) const +{ + TParameters::const_iterator pIt = this->m_Parameters.find( name ); + if( pIt != this->m_Parameters.end( ) ) + return( pIt->second.first == Self::Index ); + return( false ); +} + +// ------------------------------------------------------------------------- +bool cpPlugins::Interface::Parameters:: +HasPointValue( const TString& name ) const +{ + TParameters::const_iterator pIt = this->m_Parameters.find( name ); + if( pIt != this->m_Parameters.end( ) ) + return( pIt->second.first == Self::Point ); + return( false ); +} + +// ------------------------------------------------------------------------- +bool cpPlugins::Interface::Parameters:: +HasStringListValue( const TString& name ) const +{ + TParameters::const_iterator pIt = this->m_Parameters.find( name ); + if( pIt != this->m_Parameters.end( ) ) + return( pIt->second.first == Self::StringList ); + return( false ); +} + +// ------------------------------------------------------------------------- +bool cpPlugins::Interface::Parameters:: +HasBoolListValue( const TString& name ) const +{ + TParameters::const_iterator pIt = this->m_Parameters.find( name ); + if( pIt != this->m_Parameters.end( ) ) + return( pIt->second.first == Self::BoolList ); + return( false ); +} + +// ------------------------------------------------------------------------- +bool cpPlugins::Interface::Parameters:: +HasIntListValue( const TString& name ) const +{ + TParameters::const_iterator pIt = this->m_Parameters.find( name ); + if( pIt != this->m_Parameters.end( ) ) + return( pIt->second.first == Self::IntList ); + return( false ); +} + +// ------------------------------------------------------------------------- +bool cpPlugins::Interface::Parameters:: +HasUintListValue( const TString& name ) const +{ + TParameters::const_iterator pIt = this->m_Parameters.find( name ); + if( pIt != this->m_Parameters.end( ) ) + return( pIt->second.first == Self::UintList ); + return( false ); +} + +// ------------------------------------------------------------------------- +bool cpPlugins::Interface::Parameters:: +HasRealListValue( const TString& name ) const +{ + TParameters::const_iterator pIt = this->m_Parameters.find( name ); + if( pIt != this->m_Parameters.end( ) ) + return( pIt->second.first == Self::RealList ); + return( false ); +} + +// ------------------------------------------------------------------------- +bool cpPlugins::Interface::Parameters:: +HasIndexListValue( const TString& name ) const +{ + TParameters::const_iterator pIt = this->m_Parameters.find( name ); + if( pIt != this->m_Parameters.end( ) ) + return( pIt->second.first == Self::IndexList ); + return( false ); +} + +// ------------------------------------------------------------------------- +bool cpPlugins::Interface::Parameters:: +HasPointListValue( const TString& name ) const +{ + TParameters::const_iterator pIt = this->m_Parameters.find( name ); + if( pIt != this->m_Parameters.end( ) ) + return( pIt->second.first == Self::PointList ); + return( false ); +} + // eof - $RCSfile$