int main( int argc, char* argv[] )
{
// Load interface
- cpPlugins::Interface interface;
- interface.GuessAccesiblePlugins( );
+ cpPlugins::Interface* interface = NULL;
+ try
+ {
+ interface = new cpPlugins::Interface( );
+ interface->GuessAccesiblePlugins( );
+ }
+ catch( std::exception& err )
+ {
+ if( interface != NULL )
+ delete interface;
+ std::cerr
+ << "Error caught: "
+ << err.what( )
+ << std::endl;
+ return( 1 );
+
+ } // yrt
// Show loaded plugins
- auto plugins = interface.GetPlugins( );
+ auto plugins = interface->GetPlugins( );
for( auto pIt = plugins.begin( ); pIt != plugins.end( ); ++pIt )
std::cout << "Plugin: " << *pIt << std::endl;
std::cout << std::endl;
// Show loaded filters
- auto filters = interface.GetFilters( );
+ auto filters = interface->GetFilters( );
for( auto cIt = filters.begin( ); cIt != filters.end( ); ++cIt )
{
std::cout << "Category: " << cIt->first << std::endl;
<< std::endl;
} // rof
+
+ // Free all and finish
+ delete interface;
return( 0 );
}