Ejemplo n.º 1
0
void Creator::create( const KODE::Class::List &list )
{
  KODE::Printer printer;
  printer.setOutputDirectory( mOutputDirectory );

  QStringList cppFiles;

  KODE::Class::List::ConstIterator it;
  for ( it = list.begin(); it != list.end(); ++it ) {
    KODE::File file;

    if ( !mNameSpace.isEmpty() )
      file.setNameSpace( mNameSpace );

    file.setFilename( (*it).name().lower() );
    file.addCopyright( 2005, "Tobias Koenig", "*****@*****.**" );
    file.setLicense( KODE::License( KODE::License::GPL ) );

    file.insertClass( *it );

    printer.printHeader( file );
    printer.printImplementation( file );

    cppFiles.append( file.filename() + ".cpp" );
  }

  KODE::AutoMakefile::Target libTarget( "bin_PROGRAMS", "kwsdl" );
  libTarget.setSources( "main.cc " + cppFiles.join( " " ) );
  libTarget.setLdFlags( "$(all_libraries) $(KDE_RPATH)" );
  libTarget.setLdAdd( "-lkdecore -lkio" );

  KODE::AutoMakefile makefile;
  makefile.addTarget( libTarget );
  makefile.addEntry( "INCLUDES", "-I$(top_srcdir) -I$(top_srcdir)/libkdepim $(all_includes)" );
  makefile.addEntry( "METASOURCES", "AUTO" );

  printer.printAutoMakefile( makefile );
}
Ejemplo n.º 2
0
void Creator::create( const KODE::Class::List &list )
{
  KODE::Printer printer;
  printer.setOutputDirectory( Settings::self()->outputDirectory() );

  // Set generated header details.
  printer.setCreationWarning( true );
  printer.setGenerator( QLatin1String( "kwsdl_compiler" ) );
  printer.setSourceFile( Settings::self()->wsdlFileName() );

  const KODE::Class::List classes = sortByBaseClass( list );

  KODE::File file;

  file.setFilename( Settings::self()->outputFileName() );

  KODE::Class::List::ConstIterator it;
  for ( it = classes.constBegin(); it != classes.constEnd(); ++it ) {
    file.insertClass( *it );
  }

  printer.printHeader( file );
  printer.printImplementation( file );
}