本文整理汇总了C++中Generator::setOutputDirectory方法的典型用法代码示例。如果您正苦于以下问题:C++ Generator::setOutputDirectory方法的具体用法?C++ Generator::setOutputDirectory怎么用?C++ Generator::setOutputDirectory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Generator
的用法示例。
在下文中一共展示了Generator::setOutputDirectory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: generate
QString GeneratorSetD::generate() {
// Ui conversion...
if (do_ui_convert) {
UiConverter converter;
converter.setClasses(builder.classes());
converter.convertToJui(ui_file_name, custom_widgets);
return 0;
} else if (!custom_widgets.isEmpty()) {
fprintf(stderr, "NOTE: The --custom-widgets option only has an effect when used with --convert-to-jui");
}
// Code generation
QList<Generator *> generators;
PriGenerator *priGenerator = new PriGenerator;
ContainerGenerator *cointainerGenerator;
DGenerator *d_generator = 0;
CppHeaderGenerator *cpp_header_generator = 0;
CppImplGenerator *cpp_impl_generator = 0;
MetaInfoGenerator *metainfo = 0;
JumpTablePreprocessor *jumpTablePreprocessor = 0;
JumpTableGenerator *jumpTableGenerator = 0;
ClassFromEntry::construct(builder.classes());
QStringList contexts;
if (build_qdoc_japi) {
generators << new QDocGenerator;
contexts << "QDocGenerator";
}
if (native_jump_table) {
jumpTablePreprocessor = new JumpTablePreprocessor();
generators << jumpTablePreprocessor;
contexts << "JumpTablePreprocessor";
}
if (!no_d) {
d_generator = new DGenerator;
d_generator->setDocumentationDirectory(doc_dir);
d_generator->setDocumentationEnabled(docs_enabled);
d_generator->setNativeJumpTable(native_jump_table);
generators << d_generator;
contexts << "JavaGenerator";
}
if (!no_cpp_h) {
cpp_header_generator = new CppHeaderGenerator(priGenerator);
generators << cpp_header_generator;
contexts << "CppHeaderGenerator";
}
if (!no_cpp_impl) {
cpp_impl_generator = new CppImplGenerator(priGenerator);
cpp_impl_generator->setNativeJumpTable(native_jump_table);
generators << cpp_impl_generator;
contexts << "CppImplGenerator";
}
if (native_jump_table) {
jumpTableGenerator = new JumpTableGenerator(jumpTablePreprocessor, priGenerator);
generators << jumpTableGenerator;
contexts << "JumpTableGenerator";
}
if (!no_metainfo) {
metainfo = new MetaInfoGenerator(priGenerator);
generators << metainfo;
contexts << "MetaInfoGenerator";
}
if (build_class_list) {
generators << new ClassListGenerator;
contexts << "ClassListGenerator";
}
cointainerGenerator = new ContainerGenerator(cpp_impl_generator);
generators << priGenerator;
contexts << "PriGenerator";
generators << cointainerGenerator;
contexts << "cointainerGenerator";
for (int i=0; i<generators.size(); ++i) {
Generator *generator = generators.at(i);
ReportHandler::setContext(contexts.at(i));
generator->setOutputDirectory(outDir);
generator->setClasses(builder.classes());
if (printStdout)
generator->printClasses();
else
generator->generate();
}
QString res;
res = QString("Classes in typesystem: %1\n"
//.........这里部分代码省略.........
示例2: generate
QString GeneratorSetDylan::generate() {
// Code generation
QList<Generator *> generators;
LibraryGenerator *libraryGenerator = new LibraryGenerator;
LidGenerator *lidGenerator = new LidGenerator;
DylanGenerator *dylan_generator = 0;
PlainCppHeaderGenerator *cpp_header_generator = 0;
PlainCppImplGenerator *cpp_impl_generator = 0;
QStringList contexts;
dylan_generator = new DylanGenerator(libraryGenerator, lidGenerator);
if (!javaOutDir.isNull())
dylan_generator->setDylanOutputDirectory(javaOutDir);
if (!outDir.isNull())
dylan_generator->setLogOutputDirectory(outDir);
generators << dylan_generator;
contexts << "DylanGenerator";
cpp_header_generator = new PlainCppHeaderGenerator(lidGenerator);
if (!cppOutDir.isNull())
cpp_header_generator->setCppOutputDirectory(cppOutDir);
generators << cpp_header_generator;
contexts << "PlainCppHeaderGenerator";
cpp_impl_generator = new PlainCppImplGenerator(lidGenerator);
if (!cppOutDir.isNull())
cpp_impl_generator->setCppOutputDirectory(cppOutDir);
generators << cpp_impl_generator;
contexts << "PlainCppImplGenerator";
if (!cppOutDir.isNull())
lidGenerator->setCppOutputDirectory(cppOutDir);
generators << lidGenerator;
contexts << "LidGenerator";
if (!cppOutDir.isNull())
libraryGenerator->setOutputDirectory(cppOutDir);
generators << libraryGenerator;
contexts << "LibraryGenerator";
for (int i = 0; i < generators.size(); ++i) {
Generator *generator = generators.at(i);
ReportHandler::setContext(contexts.at(i));
if (generator->outputDirectory().isNull())
generator->setOutputDirectory(outDir);
generator->setClasses(builder.classes());
if (printStdout)
generator->printClasses();
else
generator->generate();
}
QString res;
res = QString("Classes in typesystem: %1\n"
"Generated:\n"
" - dylan.....: %2 (%3)\n"
" - cpp-impl..: %4 (%5)\n"
" - cpp-h.....: %6 (%7)\n"
" - library...: %8 (%9)\n"
" - lid.......: %10 (%11)\n"
)
.arg(builder.classes().size())
.arg(dylan_generator ? dylan_generator->numGenerated() : 0)
.arg(dylan_generator ? dylan_generator->numGeneratedAndWritten() : 0)
.arg(cpp_impl_generator ? cpp_impl_generator->numGenerated() : 0)
.arg(cpp_impl_generator ? cpp_impl_generator->numGeneratedAndWritten() : 0)
.arg(cpp_header_generator ? cpp_header_generator->numGenerated() : 0)
.arg(cpp_header_generator ? cpp_header_generator->numGeneratedAndWritten() : 0)
.arg(libraryGenerator->numGenerated())
.arg(libraryGenerator->numGeneratedAndWritten())
.arg(lidGenerator->numGenerated())
.arg(lidGenerator->numGeneratedAndWritten());
return res;
}