#include <iostream>
#include <string>
-#include <cpPlugins/Interface/Plugins.h>
+#include <cpPlugins/Interface/Interface.h>
// -------------------------------------------------------------------------
-typedef cpPlugins::Interface::Plugins TPlugins;
-typedef TPlugins::TStringContainer TStringContainer;
+typedef cpPlugins::Interface::Interface TInterface;
// -------------------------------------------------------------------------
int main( int argc, char* argv[] )
} // fi
- // Create interface
- cpPlugins::Interface::Plugins plugins;
+ // Create interface and load plugins
+ TInterface interface;
for( int i = 1; i < argc; ++i )
- if( !plugins.LoadPlugins( argv[ i ] ) )
+ if( !interface.Load( argv[ i ] ) )
std::cerr
<< "Error loading plugins file \""
<< argv[ i ] << "\""
<< std::endl;
- TStringContainer categories;
- plugins.GetLoadedCategories( categories );
- for( auto pIt = categories.begin( ); pIt != categories.end( ); ++pIt )
+ // Show info
+ auto i = interface.GetLoadedPlugins( ).begin( );
+ for( ; i != interface.GetLoadedPlugins( ).end( ); ++i )
{
- std::cout << "Category: " << *pIt << std::endl;
- const TStringContainer& filters = plugins.GetLoadedFilters( *pIt );
- for( auto fIt = filters.begin( ); fIt != filters.end( ); ++fIt )
- std::cout << "\t" << *fIt << std::endl;
+ std::cout << "Folder: " << i->first << std::endl;
+ auto j = i->second.begin( );
+ for( ; j != i->second.end( ); ++j )
+ std::cout << "\tPlugin: " << *j << std::endl;
+
+ } // rof
+
+ // Show loaded classes
+ auto cat = interface.GetClasses( ).begin( );
+ for( ; cat != interface.GetClasses( ).end( ); ++cat )
+ {
+ std::cout << "Catergory -> " << cat->first << std::endl;
+ auto cla = cat->second.begin( );
+ for( ; cla != cat->second.end( ); ++cla )
+ std::cout << "\tClass -> " << cla->first << std::endl;
} // rof