-#define cpPlugins_Parameters_ClearList( Y ) \
- void cpPlugins::Interface::Parameters:: \
- Clear##Y##List( const TString& name ) \
- { \
- auto i = this->m_Parameters.find( name ); \
- if( i == this->m_Parameters.end( ) ) \
- return; \
- if( i->second.first != Self::Y##List ) \
- return; \
- i->second.second = ""; \
- this->Modified( ); \
- }
+std::string cpPlugins::Interface::Parameters::
+GetAcceptedFileExtensions( const std::string& name ) const
+{
+ auto i = this->m_AcceptedFileExtensions.find( name );
+ if( i != this->m_AcceptedFileExtensions.end( ) )
+ return( i->second );
+ else
+ return( "" );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Interface::Parameters::
+SetAcceptedFileExtensions(
+ const std::string& name, const std::string& extensions
+ )
+{
+ auto i = this->m_Parameters.find( name );
+ if( i != this->m_Parameters.end( ) )
+ {
+ bool is_valid = ( i->second.first == Self::OpenFileName );
+ is_valid |= ( i->second.first == Self::SaveFileName );
+ is_valid |= ( i->second.first == Self::OpenFileNameList );
+ is_valid |= ( i->second.first == Self::SaveFileNameList );
+ if( is_valid )
+ this->m_AcceptedFileExtensions[ name ] = extensions;