#include #include #include #include int main( int argc, char* argv[] ) { // Open file if( argc < 4 ) { std::cerr << "Usage: " << argv[ 0 ] << " output_code namespace filter1 filter2 ..." << std::endl; return( 1 ); } // fi std::ofstream output_code( argv[ 1 ] ); if( !output_code ) { std::cerr << "Could not open file \"" << argv[ 1 ] << "\" for writing" << std::endl; return( 1 ); } // fi output_code << "#include " << std::endl; for( int i = 3; i < argc; ++i ) output_code << "#include \"" << argv[ i ] << "\"" << std::endl; output_code << std::endl << "PLUMA_CONNECTOR" << std::endl << "bool connect( pluma::Host& host )" << std::endl << "{" << std::endl << " using namespace " << argv[ 2 ] << ";" << std::endl; for( int i = 3; i < argc; ++i ) { boost::filesystem::path p( argv[ i ] ); output_code << " host.add( new " << p.stem( ).generic_string( ) << "Provider( ) );" << std::endl; } // rof output_code << " return( true );" << std::endl << "}" << std::endl; // Finish output_code.close( ); return( 0 ); } // eof - $RCSfile$