+#include <cstring>
#include <fstream>
#include <iostream>
#include <string>
-#include <boost/filesystem/path.hpp>
+// -------------------------------------------------------------------------
+std::string GetFileName( const std::string& path )
+{
+ // Extract filename
+ char* buffer = new char[ path.size( ) + 1 ];
+ std::memcpy( buffer, path.c_str( ), path.size( ) );
+ buffer[ path.size( ) ] = '\0';
+ char* tok = std::strtok( buffer, "/\\" );
+ char* ptr_fname = tok;
+ while( tok != NULL )
+ {
+ ptr_fname = tok;
+ tok = std::strtok( NULL, "/\\" );
+ } // elihw
+ std::string fname( ptr_fname );
+ delete [] buffer;
+
+ // Delete extension
+ std::size_t pos = fname.find_last_of( "." );
+ if( pos != std::string::npos )
+ fname = fname.substr( 0, pos );
+
+ return( fname );
+}
+
+// -------------------------------------------------------------------------
int main( int argc, char* argv[] )
{
// Open file
<< " 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( )
+ << GetFileName( argv[ i ] )
<< "Provider( ) );"
<< std::endl;
- } // rof
-
output_code
<< " return( true );" << std::endl
<< "}" << std::endl;