]> Creatis software - cpPlugins.git/blob - appli/examples/example_LoadPluginsDirectory.cxx
... and on linux again
[cpPlugins.git] / appli / examples / example_LoadPluginsDirectory.cxx
1 #include <iostream>
2 #include <cpPlugins/Interface.h>
3
4 int main( int argc, char* argv[] )
5 {
6   if( argc < 2 )
7   {
8     std::cerr << "Usage: " << argv[ 0 ] << " plugins_libraries" << std::endl;
9     return( 1 );
10
11   } // fi
12
13   // Load interface
14   cpPlugins::Interface interface;
15   for( int i = 1; i < argc; ++i )
16   {
17     try
18     {
19       interface.LoadPluginFile( argv[ i ] );
20     }
21     catch( ... )
22     {
23     } // yrt
24
25   } // rof
26
27   // Show loaded filters
28   auto filters = interface.GetFilters( );
29   for( auto cIt = filters.begin( ); cIt != filters.end( ); ++cIt )
30   {
31     std::cout << "Category: " << cIt->first << std::endl;
32     for( auto nIt = cIt->second.begin( ); nIt != cIt->second.end( ); ++nIt )
33       std::cout
34         << "\tFilter: " << *nIt
35         << std::endl;
36
37   } // rof
38   return( 0 );
39 }
40
41 // eof - $RCSfile$