Esempio n. 1
0
 TranslationUnit *parse(const QByteArray &source,
                        TranslationUnit::ParseMode mode,
                        bool enableObjc,
                        bool qtMocRun)
 {
     const StringLiteral *fileId = control->stringLiteral("<stdin>");
     TranslationUnit *unit = new TranslationUnit(control.data(), fileId);
     unit->setSource(source.constData(), source.length());
     unit->setObjCEnabled(enableObjc);
     unit->setQtMocRunEnabled(qtMocRun);
     unit->parse(mode);
     return unit;
 }
Esempio n. 2
0
 TranslationUnit *parse(const QByteArray &source,
                        TranslationUnit::ParseMode mode,
                        bool blockErrors = false,
                        bool qtMocRun = false)
 {
     const StringLiteral *fileId = control.stringLiteral("<stdin>");
     TranslationUnit *unit = new TranslationUnit(&control, fileId);
     unit->setObjCEnabled(true);
     unit->setQtMocRunEnabled(qtMocRun);
     unit->setSource(source.constData(), source.length());
     unit->blockErrors(blockErrors);
     unit->parse(mode);
     return unit;
 }