Exemplo n.º 1
0
QT_END_NAMESPACE

int main(int argc, char **argv)
{
    QT_USE_NAMESPACE

#ifndef QT_BOOTSTRAPPED
    QCoreApplication app(argc, argv);
#endif
    QString cf = "qsauncompress \1 \2";
    PolyArchiveExtractor qsaExtractor(QStringList() << "qsa",cf);
    cf = "tar -C \2 -xf \1";
    PolyArchiveExtractor tarExtractor(QStringList() << "tar",cf);
    cf = "tar -C \2 -Zxf \1";
    PolyArchiveExtractor tazExtractor(QStringList() << "taz",cf);
    cf = "tar -C \2 -jxf \1";
    PolyArchiveExtractor tbz2Extractor(QStringList() << "tbz" << "tbz2",cf);
    cf = "tar -C \2 -zxf \1";
    PolyArchiveExtractor tgzExtractor(QStringList() << "tgz",cf);
    cf = "unzip \1 -d \2";
    PolyArchiveExtractor zipExtractor(QStringList() << "zip",cf);
    cf = "bunzip2 -c \1 > \2";
    PolyUncompressor bz2Uncompressor(QStringList() << "bz" << "bz2",cf);
    cf = "gunzip -c \1 > \2";
    PolyUncompressor gzAndZUncompressor(QStringList() << "gz" << "z" << "Z",cf);
    cf = "unzip -c \1 > \2";
    PolyUncompressor zipUncompressor(QStringList() << "zip",cf);

    /*
      Create code parsers for the languages to be parsed,
      and create a tree for C++.
     */
    CppCodeParser cppParser;
    Tree *cppTree = treeForLanguage(cppParser.language());

    QsCodeParser qsParser(cppTree);
    QsaKernelParser qsaKernelParser(cppTree);
    JambiApiParser jambiParser(cppTree);

    /*
      Create code markers for plain text, C++, Java, and qs.
     */
    PlainCodeMarker plainMarker;
    CppCodeMarker cppMarker;
    JavaCodeMarker javaMarker;
    QsCodeMarker qsMarker;

    ApiGenerator apiGenerator;
    HtmlGenerator htmlGenerator;
    JavadocGenerator javadocGenerator;
    LinguistGenerator linguistGenerator;
    LoutGenerator loutGenerator;
    ManGenerator manGenerator;
    SgmlGenerator smglGenerator;
    WebXMLGenerator webxmlGenerator;
    DitaXmlGenerator ditaxmlGenerator;

    QStringList qdocFiles;
    QString opt;
    int i = 1;

    while (i < argc) {
        opt = argv[i++];

	if (opt == "-help") {
	    printHelp();
	    return EXIT_SUCCESS;
	}
        else if (opt == "-version") {
	    printVersion();
	    return EXIT_SUCCESS;
	}
        else if (opt == "--") {
	    while (i < argc)
		qdocFiles.append(argv[i++]);
        }
        else if (opt.startsWith("-D")) {
            QString define = opt.mid(2);
            defines += define;
        }
        else if (opt == "-slow") {
            slow = true;
	}
        else if (opt == "-showinternal") {
            showInternal = true;
        }
        else if (opt == "-obsoletelinks") {
            obsoleteLinks = true;
        }
        else {
	    qdocFiles.append(opt);
	}
    }

	if (qdocFiles.isEmpty()) {
        printHelp();
        return EXIT_FAILURE;
    }

    /*
      Main loop.
     */
    foreach (QString qf, qdocFiles) {
        //qDebug() << "PROCESSING:" << qf;
	processQdocconfFile(qf);
    }
Exemplo n.º 2
0
int main( int argc, char **argv )
{
    QCoreApplication app(argc, argv);

    PolyArchiveExtractor qsaExtractor( QStringList() << "qsa",
				       "qsauncompress \1 \2" );
    PolyArchiveExtractor tarExtractor( QStringList() << "tar",
				       "tar -C \2 -xf \1" );
    PolyArchiveExtractor tazExtractor( QStringList() << "taz",
				       "tar -C \2 -Zxf \1" );
    PolyArchiveExtractor tbz2Extractor( QStringList() << "tbz" << "tbz2",
					"tar -C \2 -jxf \1" );
    PolyArchiveExtractor tgzExtractor( QStringList() << "tgz",
				       "tar -C \2 -zxf \1" );
    PolyArchiveExtractor zipExtractor( QStringList() << "zip",
				       "unzip \1 -d \2" );

    PolyUncompressor bz2Uncompressor( QStringList() << "bz" << "bz2",
				      "bunzip2 -c \1 > \2" );
    PolyUncompressor gzAndZUncompressor( QStringList() << "gz" << "z" << "Z",
					 "gunzip -c \1 > \2" );
    PolyUncompressor zipUncompressor( QStringList() << "zip",
				      "unzip -c \1 > \2" );

    CCodeParser cParser;
    CppCodeParser cppParser;

    Tree *cppTree = treeForLanguage( cppParser.language() );

    QsCodeParser qsParser( cppTree );
    QsaKernelParser qsaKernelParser( cppTree );
    JambiApiParser jambiParser(cppTree);

    PlainCodeMarker plainMarker;
    CppCodeMarker cppMarker;
    JavaCodeMarker javaMarker;
    QsCodeMarker qsMarker;

    ApiGenerator apiGenerator;
    HtmlGenerator htmlGenerator;
    JavadocGenerator javadocGenerator;
    LoutGenerator loutGenerator;
    ManGenerator manGenerator;
    SgmlGenerator smglGenerator;
    WebXMLGenerator webxmlGenerator;

    QStringList qdocFiles;
    QString opt;
    int i = 1;

    while ( i < argc ) {
	opt = argv[i++];

	if ( opt == "-help" ) {
	    printHelp();
	    return EXIT_SUCCESS;
	} else if ( opt == "-version" ) {
	    printVersion();
	    return EXIT_SUCCESS;
	} else if ( opt == "--" ) {
	    while ( i < argc )
		qdocFiles.append( argv[i++] );
        } else if ( opt.startsWith("-D") ) {
            QString define = opt.mid(2);
            defines += define;
        } else if (opt == "-slow") {
            slow = true;
	} else {
	    qdocFiles.append( opt );
	}
    }

    if ( qdocFiles.isEmpty() ) {
	printHelp();
	return EXIT_FAILURE;
    }

    foreach (QString qf, qdocFiles)
	processQdocconfFile( qf );

    qDeleteAll(trees);
    return EXIT_SUCCESS;
}