X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=appli%2Fexamples%2Fexample_LoadPlugins.cxx;h=d090d38318e718f877c5726f5f28ff3affa85d46;hb=c3c3da5217b6eb255db9c0424f22d4e01250901e;hp=e46a5db137487004897407233402a412596aa6b4;hpb=48412b66ce1d8d8831625f1a3f51f7e78825f9a1;p=cpPlugins.git diff --git a/appli/examples/example_LoadPlugins.cxx b/appli/examples/example_LoadPlugins.cxx index e46a5db..d090d38 100644 --- a/appli/examples/example_LoadPlugins.cxx +++ b/appli/examples/example_LoadPlugins.cxx @@ -7,30 +7,30 @@ int main( int argc, char* argv[] ) { if( argc < 2 ) { - std::cerr << "Usage: " << argv[ 0 ] << " plugins_file" << std::endl; + std::cerr << "Usage: " << argv[ 0 ] << " plugins_file(s)" << std::endl; return( 1 ); } // fi - std::string plugins_file = argv[ 1 ]; // Create interface typedef cpPlugins::Interface::Interface TInterface; typedef TInterface::TClasses TClasses; TInterface plugins; - if( !plugins.Load( plugins_file ) ) - { - std::cerr << "Error loading plugins file." << std::endl; - return( 1 ); + for( int i = 1; i < argc; ++i ) + if( !plugins.Load( argv[ i ] ) ) + std::cerr + << "Error loading plugins file \"" + << argv[ i ] << "\"" + << std::endl; - } // fi - std::cout << "---------------------------------------------" << std::endl; std::cout << "Loaded classes:" << std::endl; TClasses::const_iterator cIt = plugins.GetClasses( ).begin( ); for( ; cIt != plugins.GetClasses( ).end( ); ++cIt ) std::cout << " := " << cIt->first << std::endl; std::cout << "---------------------------------------------" << std::endl; + return( 0 ); }