]> Creatis software - cpPlugins.git/blob - appli/examples/plugins/example_plugins_GuessPlugins.cxx
77a7494beb7e508c5f947c7aa188c2673c2cdf18
[cpPlugins.git] / appli / examples / plugins / example_plugins_GuessPlugins.cxx
1 #include <iostream>
2 #include <cpPlugins/Interface.h>
3
4 int main( int argc, char* argv[] )
5 {
6   // Create interface and load library
7   cpPlugins::Interface interface;
8   try
9   {
10     interface.LoadEnvironments( );
11     interface.GuessPlugins( );
12   }
13   catch( std::exception& err )
14   {
15     std::cerr << "Error caught: " << err.what( ) << std::endl;
16     return( 1 );
17
18   } // yrt
19
20   // Show data
21   std::cout << "----- PATHS -----" << std::endl;
22   auto paths = interface.GetPaths( );
23   for( auto paIt = paths.begin( ); paIt != paths.end( ); ++paIt )
24     std::cout << *paIt << std::endl;
25   std::cout << std::endl << "----- PLUGINS -----" << std::endl;
26   auto plugins = interface.GetPlugins( );
27   for( auto plIt = plugins.begin( ); plIt != plugins.end( ); ++plIt )
28     std::cout << *plIt << std::endl;
29   std::cout << std::endl << "----- FILTERS -----" << std::endl;
30   auto categories = interface.GetCategories( );
31   for( auto cIt = categories.begin( ); cIt != categories.end( ); ++cIt )
32   {
33     std::cout << "\t** Category: " << *cIt << " **" << std::endl;
34     auto filters = interface.GetFilters( *cIt );
35     for( auto fIt = filters.begin( ); fIt != filters.end( ); ++fIt )
36       std::cout << "\t\tFilter: " << *fIt << std::endl;
37
38   } // rof
39
40   // Finish
41   return( 0 );
42 }
43
44 // eof - $RCSfile$