]> Creatis software - cpPlugins.git/blobdiff - appli/examples/plugins/example_LoadPluginsDirectory.cxx
...
[cpPlugins.git] / appli / examples / plugins / example_LoadPluginsDirectory.cxx
similarity index 69%
rename from appli/examples/example_LoadPluginsDirectory.cxx
rename to appli/examples/plugins/example_LoadPluginsDirectory.cxx
index cdda427157aeb7aadf448acb5777fd8c7e8e3ca1..4e9366db072ab0e5a137d4cd0833fdedfea5b88d 100644 (file)
@@ -5,24 +5,23 @@ int main( int argc, char* argv[] )
 {
   if( argc < 2 )
   {
-    std::cerr << "Usage: " << argv[ 0 ] << " plugins_libraries" << std::endl;
+    std::cerr << "Usage: " << argv[ 0 ] << " plugins_libraries_dir" << std::endl;
     return( 1 );
 
   } // fi
 
   // Load interface
   cpPlugins::Interface interface;
-  for( int i = 1; i < argc; ++i )
+  try
   {
-    try
-    {
-      interface.LoadPluginFile( argv[ i ] );
-    }
-    catch( ... )
-    {
-    } // yrt
+    interface.LoadPluginDir( argv[ 1 ] );
+  }
+  catch( std::exception& err )
+  {
+    std::cerr << "Error caught: " << err.what( ) << std::endl;
+    return( 1 );
 
-  } // rof
+  } // yrt
 
   // Show loaded filters
   auto filters = interface.GetFilters( );