当前位置: 首页>>代码示例>>C++>>正文


C++ CodeGenerator::initFromParentDocument方法代码示例

本文整理汇总了C++中CodeGenerator::initFromParentDocument方法的典型用法代码示例。如果您正苦于以下问题:C++ CodeGenerator::initFromParentDocument方法的具体用法?C++ CodeGenerator::initFromParentDocument怎么用?C++ CodeGenerator::initFromParentDocument使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CodeGenerator的用法示例。


在下文中一共展示了CodeGenerator::initFromParentDocument方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: createObject

CodeGenerator* createObject(Uml::ProgrammingLanguage::Enum pl)
{
    CodeGenerator* obj = 0;
    Settings::OptionState optionState = Settings::optionState();
    switch (pl) {
        case Uml::ProgrammingLanguage::Ada:
            obj = new AdaWriter();
            break;
        case Uml::ProgrammingLanguage::ActionScript:
            obj = new ASWriter();
            break;
        case Uml::ProgrammingLanguage::Cpp:
            if (optionState.generalState.newcodegen) {
                obj = new CPPCodeGenerator();
                obj->connect_newcodegen_slots();
            } else {
                obj = new CppWriter();
            }
            break;
        case Uml::ProgrammingLanguage::CSharp:
            obj = new CSharpWriter();
            break;
        case Uml::ProgrammingLanguage::D:
            if (optionState.generalState.newcodegen) {
                obj = new DCodeGenerator();
                obj->connect_newcodegen_slots();
            } else {
                obj = new DWriter();
            }
            break;
        case Uml::ProgrammingLanguage::IDL:
            obj = new IDLWriter();
            break;
        case Uml::ProgrammingLanguage::Java:
            if (optionState.generalState.newcodegen) {
                obj = new JavaCodeGenerator();
                obj->connect_newcodegen_slots();
            } else {
                obj = new JavaWriter();
            }
            break;
        case Uml::ProgrammingLanguage::JavaScript:
            obj = new JSWriter();
            break;
        case Uml::ProgrammingLanguage::MySQL:
            obj = new MySQLWriter();
            break;
        case Uml::ProgrammingLanguage::PHP:
            obj = new PhpWriter();
            break;
        case Uml::ProgrammingLanguage::PHP5:
            obj = new Php5Writer();
            break;
        case Uml::ProgrammingLanguage::Pascal:
            obj = new PascalWriter();
            break;
        case Uml::ProgrammingLanguage::Perl:
            obj = new PerlWriter();
            break;
        case Uml::ProgrammingLanguage::PostgreSQL:
            obj = new PostgreSQLWriter();
            break;
        case Uml::ProgrammingLanguage::Python:
            obj = new PythonWriter();
            break;
        case Uml::ProgrammingLanguage::Ruby:
            if (optionState.generalState.newcodegen) {
                obj = new RubyCodeGenerator();
                obj->connect_newcodegen_slots();
            } else {
                obj = new RubyWriter();
            }
            break;
        case Uml::ProgrammingLanguage::SQL:
            obj = new SQLWriter();
            break;
        case Uml::ProgrammingLanguage::Tcl:
            obj = new TclWriter();
            break;
        case Uml::ProgrammingLanguage::Vala:
            obj = new ValaWriter();
            break;
        case Uml::ProgrammingLanguage::XMLSchema:
            obj = new XMLSchemaWriter();
            break;
        default:
            uWarning() << "cannot create object of type "
                       << Uml::ProgrammingLanguage::toString(pl)
                       << ". Type unknown";
            break;
    }

    UMLApp::app()->setPolicyExt(CodeGenFactory::newCodeGenPolicyExt(pl));
    if (obj) {
        obj->initFromParentDocument();
    }
    return obj;
}
开发者ID:evaldobarbosa,项目名称:umbrello,代码行数:98,代码来源:codegenfactory.cpp


注:本文中的CodeGenerator::initFromParentDocument方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。