]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Interface/Parameters.cxx
Parameters improved
[cpPlugins.git] / lib / cpPlugins / Interface / Parameters.cxx
index a42582cbec15148dcb39fd4fdd378b0d3415ba77..b8d358b5103891ed27eed7bf590cfd50865604da 100644 (file)
@@ -19,6 +19,7 @@
   }
 
 cpPlugins_Interface_Parameters_SetMacro( String );
+cpPlugins_Interface_Parameters_SetMacro( Bool );
 cpPlugins_Interface_Parameters_SetMacro( Int );
 cpPlugins_Interface_Parameters_SetMacro( Uint );
 cpPlugins_Interface_Parameters_SetMacro( Real );
@@ -127,6 +128,19 @@ GetValueAsString( const TString& name ) const
   return( pIt->second.second );
 }
 
+// -------------------------------------------------------------------------
+cpPlugins::Interface::Parameters::
+TBool cpPlugins::Interface::Parameters::
+GetValueAsBool( const TString& name ) const
+{
+  TParameters::const_iterator pIt = this->m_Parameters.find( name );
+  if( pIt == this->m_Parameters.end( ) )
+    return( TBool( false ) );
+  if( pIt->second.first != Self::Int )
+    return( TBool( false ) );
+  return( TBool( std::atoi( pIt->second.second.c_str( ) ) == 1 ) );
+}
+
 // -------------------------------------------------------------------------
 cpPlugins::Interface::Parameters::
 TInt cpPlugins::Interface::Parameters::
@@ -174,6 +188,12 @@ GetValueAsStringList(
 {
 }
 
+// -------------------------------------------------------------------------
+void cpPlugins::Interface::Parameters::
+GetValueAsBoolList( std::vector< TBool >& lst, const TString& name ) const
+{
+}
+
 // -------------------------------------------------------------------------
 void cpPlugins::Interface::Parameters::
 GetValueAsIntList( std::vector< TInt >& lst, const TString& name ) const