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


C++ FileOut::idref_datatype方法代码示例

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


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

示例1: write_exceptions

void UmlOperation::write_exceptions(FileOut & out)
{
    const Q3ValueList<UmlTypeSpec> excpts = exceptions();
    Q3ValueList<UmlTypeSpec>::ConstIterator iter;

    for (iter = excpts.begin(); iter != excpts.end(); ++iter) {
        const UmlTypeSpec & e = *iter;

        if (e.type != 0) {
            out.indent();
            out << "<raisedException";
            out.idref(e.type);
            out << "/>\n";
        }
        else if (!e.explicit_type.isEmpty()) {
            out.indent();
            out << "<raisedException";
            out.idref_datatype(e.explicit_type);
            out << "/>\n";
        }
    }
}
开发者ID:bleakxanadu,项目名称:douml,代码行数:22,代码来源:UmlOperation.cpp

示例2: write_type

void UmlItem::write_type(FileOut & out, const UmlTypeSpec & t, const char * tk)
{
    if (t.type != 0) {
        out.indent();
        out << '<' << ((tk != 0) ? tk : "type") << " xmi:type=\"uml:Class\"";
        out.idref(t.type);
        out << "/>\n";
    }
    else if (!t.explicit_type.isEmpty()) {
        out.indent();
        out << '<' << ((tk != 0) ? tk : "type") << " xmi:type=\"uml:";

        if (t.explicit_type == "int")
            out << ((_uml_20)
                    ? "PrimitiveType\" href=\"http://schema.omg.org/spec/UML/2.0/uml.xml#Integer\"/>\n"
                    : "PrimitiveType\" href=\"http://schema.omg.org/spec/UML/2.1/uml.xml#Integer\"/>\n");
        else if (t.explicit_type == "bool")
            out << ((_uml_20)
                    ? "PrimitiveType\" href=\"http://schema.omg.org/spec/UML/2.0/uml.xml#Boolean\"/>\n"
                    : "PrimitiveType\" href=\"http://schema.omg.org/spec/UML/2.1/uml.xml#Boolean\"/>\n");
        else if (t.explicit_type == "string")
            out << ((_uml_20)
                    ? "PrimitiveType\" href=\"http://schema.omg.org/spec/UML/2.0/uml.xml#String\"/>\n"
                    : "PrimitiveType\" href=\"http://schema.omg.org/spec/UML/2.1/uml.xml#String\"/>\n");
        else if (t.explicit_type == "long")
            out << ((_uml_20)
                    ? "PrimitiveType\" href=\"http://schema.omg.org/spec/UML/2.0/uml.xml#UnlimitedNatural\"/>\n"
                    : "PrimitiveType\" href=\"http://schema.omg.org/spec/UML/2.1/uml.xml#UnlimitedNatural\"/>\n");
        else {
            out << "Class\"";
            out.idref_datatype(t.explicit_type);
            out << "/>\n";
        }
    }

}
开发者ID:vresnev,项目名称:douml,代码行数:36,代码来源:UmlItem.cpp

示例3: write_if_needed

bool UmlAttribute::write_if_needed(FileOut & out)
{
    switch (_lang) {
    case Uml:
        parent()->write(out);
        out.indent();
        out << "<UML:Attribute name=\"" << name() << '"';
        break;

    case Cpp:
        if (cppDecl().isEmpty())
            return FALSE;

        parent()->write(out);
        out.indent();
        out << "<UML:Attribute name=\"" << true_name(cppDecl()) << '"';
        break;

    default: // Java
        if (javaDecl().isEmpty())
            return FALSE;

        parent()->write(out);
        out.indent();
        out << "<UML:Attribute name=\"" << true_name(javaDecl()) << '"';
        break;
    }

    out.id(this);

    switch (_lang) {
    case Uml:
        write_visibility(out);
        break;

    case Cpp:
        write_visibility(out,
                         (cppVisibility() == DefaultVisibility)
                         ? visibility() : cppVisibility());
        break;

    default: // Java
        if (javaDecl().find("${visibility}") != -1)
            write_visibility(out, visibility());

        break;
    }

    write_scope(out);
    out << ">\n";
    out.indent(+1);

    const UmlTypeSpec & t = type();

    if ((t.type != 0) || !t.explicit_type.isEmpty()) {
        out.indent();
        out << "<UML:StructuralFeature.type>\n";
        out.indent();
        out << "\t<UML:DataType";

        switch (_lang) {
        case Uml:
            if (t.type != 0)
                out.idref(t.type);
            else
                out.idref_datatype(t.explicit_type);

            break;

        case Cpp:
            write_cpp_type(out);
            break;

        default: // java
            write_java_type(out);
        }

        out << "/>\n";
        out.indent();
        out << "</UML:StructuralFeature.type>\n";
    }

    write_stereotype(out);
    write_annotation(out);
    write_description_properties(out);

    out.indent(-1);
    out.indent();
    out << "</UML:Attribute>\n";

    unload();

    return TRUE;
}
开发者ID:bleakxanadu,项目名称:douml,代码行数:94,代码来源:UmlAttribute.cpp


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