2 #include <cpPlugins/Utility.h>
3 #include <cpPlugins/Interface/Plugins.h>
4 #include <cpPlugins/Interface/Workspace.h>
6 int main( int argc, char* argv[] )
12 << "Usage: " << argv[ 0 ]
13 << " workspace [parameters]" << std::endl;
18 // Create interface and load library
19 cpPlugins::Interface::Plugins::Pointer interface =
20 cpPlugins::Interface::Plugins::New( );
23 interface->GuessEnvironment( "." );
24 interface->GuessPlugins( );
26 catch( std::exception& err )
28 std::cerr << "Error caught: " << err.what( ) << std::endl;
34 cpPlugins::Interface::Workspace::Pointer workspace =
35 cpPlugins::Interface::Workspace::New( );
38 workspace->Load( argv[ 1 ] );
40 catch( std::exception& err )
43 << "Error loading workspace \"" << argv[ 1 ]
44 << "\": " << err.what( ) << std::endl;
50 for( int i = 2; i < argc; ++i )
52 std::vector< std::string > tokens;
53 cpPlugins::Tokenize( tokens, argv[ i ], "@=" );
54 if( tokens.size( ) == 3 )
56 auto filter = workspace->GetFilter( tokens[ 1 ] );
59 auto params = filter->GetParameters( );
60 params->SetString( tokens[ 0 ], tokens[ 2 ], true );
69 workspace->PrintExecutionOn( );
74 catch( std::exception& err )
76 std::cerr << std::endl << "********************************" << std::endl;
77 std::cerr << "Error caught: " << err.what( ) << std::endl;
78 std::cerr << "********************************" << std::endl;