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


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

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


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

示例1: write

void UmlNcRelation::write(FileOut & out)
{
    if ((relationKind() == aDependency) &&
            (parent()->kind() == anUseCase) &&
            (target()->kind() == anUseCase)) {
        const char * t;
        const char * r;

        if (stereotype() == "include") {
            t = "Include";
            r = "addition";
        }
        else if (stereotype() == "extend") {
            t = "Extend";
            r = "extendedCase";
        }
        else {
            write(out, TRUE);
            return;
        }

        out.indent();
        out << "<" << stereotype() << " xmi:type=\"uml:" << t << "\"";
        out.id(this);
        out.ref(target(), r);
        out << ">\n";
        out.indent(+1);
        write_description_properties(out);
        out.indent(-1);
        out.indent();
        out << "</" << stereotype() << ">\n";
    }
    else
        write(out, TRUE);
}
开发者ID:mobius3,项目名称:douml,代码行数:35,代码来源:UmlNcRelation.cpp

示例2: write

void UmlNode::write(FileOut & out)
{
    const char * k = (_uml_20) ? "ownedMember" : "packagedElement";

    out.indent();
    out << "<" << k << " xmi:type=\""
        << ((stereotype() == "device\"") ? "uml:Device" : "uml:Node\"");
    out.id(this);
    out << " name=\"";
    out.quote((const char *)name()); //[jasa] ambiguous call
    out << "\">\n";
    out.indent(+1);

    write_description_properties(out);

    const QVector<UmlItem*> ch = children();
    unsigned n = ch.size();

    for (unsigned i = 0; i != n; i += 1)
        ch[i]->write(out);

    out.indent(-1);
    out.indent();
    out << "</" << k << ">\n";

    unload();
}
开发者ID:DoUML,项目名称:douml,代码行数:27,代码来源:UmlNode.cpp

示例3: write_uml_params

void UmlOperation::write_uml_params(FileOut & out)
{
    const Q3ValueList<UmlParameter> p = params();
    Q3ValueList<UmlParameter>::ConstIterator it;

    for (it = p.begin(); it != p.end(); ++it) {
        out.indent();
        out << "<ownedParameter xmi:type=\"uml:Parameter\" name=\"" << (*it).name
            << "\" xmi:id=\"BOUML_op_param_"
            << ++param_id << "\" direction=\"";

        if (_pk_prefix)
            out << "pk_";

        switch ((*it).dir) {
        case InputOutputDirection:
            out << "inout\">\n";
            break;

        case OutputDirection:
            out << "out\">\n";
            break;

        default:
            out << "in\">\n";
        }

        out.indent(+1);
        UmlItem::write_type(out, (*it).type);
        out.indent(-1);

        out.indent();
        out << "</ownedParameter>\n";
    }
}
开发者ID:bleakxanadu,项目名称:douml,代码行数:35,代码来源:UmlOperation.cpp

示例4: write_relation

void UmlRelation::write_relation(FileOut & out) {
  // note : it is the first side
 
  if (_assoc_class != 0)
    // generated in the association class
    return;
    
  const char * k = (_uml_20) ? "ownedElement" : "packagedElement";

  out.indent();
  out << '<' << k << " xmi:type=\"uml:Association\"";
  out.id_prefix(this, "ASSOC_");
  
  Q3CString s = name();
  int i1 = s.find("(");
  int i2 = s.findRev(")");
  
  if ((i1 != -1) && (i2 != -1) && (i2 > i1) && (s[i1+1] != '<')  && (s[i2-1] != '>')) {
    s = s.mid(i1 + 1, i2 - i1 - 1);
    
    if (!s.isEmpty()) {
      out << " name=\"";
      out.quote((const char*)s);//[jasa] ambiguous call
      out << '"';
    }
  }
  write_visibility(out);
  out << ">\n";
  
  write_ends(out);
  
  out.indent();
  out << "</" << k << ">\n";

}
开发者ID:SciBoy,项目名称:douml,代码行数:35,代码来源:UmlRelation.cpp

示例5: write_extension

void UmlRelation::write_extension(FileOut & out) {
  if ((side(TRUE) == this) && 
      (parent()->stereotype() == "stereotype") &&
      (roleType()->stereotype() == "metaclass")) {
    const char * k = (_uml_20) ? "ownedMember" : "packagedElement";
    
    out.indent();
    out << "<" << k << " xmi:type=\"uml:Extension\" name=\"A_";
    out.quote((const char*)roleType()->name());//[jasa] ambiguous call
    out  << '_';
    out.quote((const char*)parent()->name());//[jasa] ambiguous call
    out << '"';
    out.id_prefix(this, "EXT_");
    out.ref(this, "memberEnd", "BASE_");
    out << ">\n";
    out.indent();
    out << "\t<ownedEnd xmi:type=\"uml:ExtensionEnd\" name=\"extension_";
    out.quote((const char*)parent()->name());//[jasa] ambiguous call
    out << '"';
    out.id_prefix(this, "EXTEND_");
    out.ref(this, "type");
    out << " aggregation=\"composite\"/>\n";
    out.indent();
    out << "</" << k << ">\n";
  }

  unload();
}
开发者ID:SciBoy,项目名称:douml,代码行数:28,代码来源:UmlRelation.cpp

示例6: write_condition

void UmlActivityAction::write_condition(FileOut & out, Q3CString cond, bool pre) {
  if (! cond.isEmpty()) {
    const char * k;
    const char * K;
    const char * body;
    
    if (pre) {
      k = "pre";
      K = "PRE_";
      body = "PRE_BODY_";
    }
    else {
      k = "post";
      K = "POST_";
      body = "POST_BODY_";
    }
    
    out.indent();
    out << '<' << k << "condition xmi:type=\"uml:Constraint\"";
    out.id_prefix(this, K);
    out << ">\n";
    out.indent();
    out << "\t<specification xmi:type=\"uml:OpaqueExpression\"";
    out.id_prefix(this, body);
    out << " body=\"";
    out.quote(cond);
    out << "\"/>\n";
    out.indent();
    out << "</" << k << "condition>\n";
  }
}
开发者ID:SciBoy,项目名称:douml,代码行数:31,代码来源:UmlActivityAction.cpp

示例7: write_if_needed

bool UmlComponent::write_if_needed(FileOut & out)
{
    parent()->write(out);

    out.indent();
    out << "<UML:Component name=\"";
    out.quote(name());
    out << '"';
    out.id(this);
    out << " visibility=\"public\" isAbstract=\"false\" isActive=\"false\" >\n";
    out.indent(+1);
    write_stereotype(out);
    write_description_properties(out);
    out.indent(-1);
    out.indent();
    out << "</UML:Component>\n";

    const Q3PtrVector<UmlItem> ch = children();
    unsigned n = ch.size();

    for (unsigned i = 0; i != n; i += 1)
        ch[i]->write_if_needed(out);

    unload();

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

示例8: write_close

void UmlActivityAction::write_close(FileOut & out) {
  out.indent(-1);
  out.indent();
  out << ((parent()->kind() == anActivity) ? "</node>\n" : "</containedNode>\n");
    
  unload();
}
开发者ID:SciBoy,项目名称:douml,代码行数:7,代码来源:UmlActivityAction.cpp

示例9: write

void UmlActivityPartition::write(FileOut & out) {
  const char * p = (parent()->kind() == aPartition)
    ? "subpartition" : "group";
  
  out.indent();
  out << "<" << p << " xmi:type=\"uml:ActivityPartition\" name=\"";
  out.quote((const char*)name());//[jasa] ambiguous call
  out << '"';
  out.id(this);
  if (isDimension())
    out << " isDimension=\"true\"";
  if (isExternal())
    out << " isExternal=\"true\"";
  if (represents() != 0)
    out.ref(represents(), "represents");
  out << ">\n";
  out.indent(+1);
  
  write_description_properties(out); 
  
  const Q3PtrVector<UmlItem> ch = children();
  unsigned n = ch.size();
  
  for (unsigned i = 0; i != n; i += 1)
    ch[i]->write(out);
  
  out.indent(-1);
  out.indent();
  out << "</" << p << ">\n";

  unload();
}
开发者ID:SciBoy,项目名称:douml,代码行数:32,代码来源:UmlActivityPartition.cpp

示例10: write

void UmlClassView::write(FileOut & out)
{
    if (_gen_views) {
        out.indent();
        out << ((_uml_20) ? "<ownedMember" : "<packagedElement")
            << " xmi:type=\"uml:Package\"";
        out.id(this);
        out << " name =\"class view ";
        out.quote(name());
        out << "\">\n";
        out.indent(+1);
        write_description_properties(out);
    }

    const QVector<UmlItem*> ch = children();
    unsigned n = ch.size();

    for (unsigned i = 0; i != n; i += 1)
        ch[i]->write(out);

    if (_gen_views) {
        while (! _relations.isEmpty())
            _relations.takeAt(0)->write(out, FALSE);

        out.indent(-1);
        out.indent();
        out << ((_uml_20) ? "</ownedMember>\n" : "</packagedElement>\n");
    }
}
开发者ID:DoUML,项目名称:douml,代码行数:29,代码来源:UmlClassView.cpp

示例11: write_multiplicity

void UmlItem::write_multiplicity(FileOut & out, WrapperStr s, UmlItem * who)
{
    if (!s.isEmpty()) {
        WrapperStr min;
        WrapperStr max;
        int index = s.find("..");

        if (index != -1) {
            min = s.left(index).stripWhiteSpace();
            max = s.mid(index + 2).stripWhiteSpace();
        }
        else
            min = max = s.stripWhiteSpace();

        out.indent();
        out << "<lowerValue xmi:type=\"uml:LiteralString\"";
        out.id_prefix(who, "MULTIPLICITY_L_");
        out << " value=\"" << min.operator QString() << "\"/>\n";

        out.indent();
        out << "<upperValue xmi:type=\"uml:LiteralString\"";
        out.id_prefix(who, "MULTIPLICITY_U_");
        out << " value=\"" << max.operator QString() << "\"/>\n";
    }
}
开发者ID:vresnev,项目名称:douml,代码行数:25,代码来源:UmlItem.cpp

示例12: write_actor

void UmlClass::write_actor(FileOut & out)
{
    out.indent();
    out << "<UML:Actor name=\"" << name() << '"';
    out.id(this);
    out << " visibility=\"public\" isAbstract=\""
        << ((isAbstract()) ? "true" : "false")
        << "\" isActive=\"false\" >\n";
    out.indent(+1);

    if (stereotype() != "actor")
        write_stereotype(out);

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

    const QVector<UmlItem*> ch = children();
    unsigned n = ch.size();

    for (unsigned i = 0; i != n; i += 1)
        if (ch[i]->kind() == aRelation)
            ch[i]->write_if_needed(out);
}
开发者ID:ErickCastellanos,项目名称:douml,代码行数:25,代码来源:UmlClass.cpp

示例13: write_events

void UmlOperation::write_events(FileOut & out)
{
    const char * k = (_uml_20) ? "ownedMember" : "packagedElement";
    UmlItem * prj = UmlPackage::getProject();
    Q3PtrDictIterator<char> it_oper(SentReceived);

    while (it_oper.current()) {
        out.indent();
        out << "<" << k << " xmi:type=\"uml:SendOperationEvent\"";
        out.id_prefix(prj, "SENDOPEREVT", (int)((long) it_oper.current()));
        out << " name=\"";
        out.quote((const char *)((UmlOperation *)it_oper.currentKey())->name()); //[jasa] ambiguous call
        out << '"';
        out.ref((UmlOperation *)it_oper.currentKey(), "operation");
        out << "/>\n";

        out.indent();
        out << "<" << k << " xmi:type=\"uml:ReceiveOperationEvent\"";
        out.id_prefix(prj, "RECOPEREVT", (int)((long) it_oper.current()));
        out << " name=\"";
        out.quote((const char *)((UmlOperation *)it_oper.currentKey())->name()); //[jasa] ambiguous call
        out << '"';
        out.ref((UmlOperation *)it_oper.currentKey(), "operation");
        out << "/>\n";

        ++it_oper;
    }

    Q3AsciiDictIterator<char> it_evt(Events);

    while (it_evt.current()) {
        out.indent();

        if (it_evt.currentKey()[0] == 'D') {
            out << "<" << k << " xmi:type=\"uml:DestructionEvent\"";
            out.id_prefix(prj, it_evt.current());
            out << "/>\n";
        }
        else {
            out << "<" << k << " xmi:type=\"uml:ExecutionEvent\"";
            out.id_prefix(prj, it_evt.current());

            if (*it_evt.currentKey() != 0) {
                out << " name=\"";
                out.quote(it_evt.currentKey() + 1);
                out << "\"/>\n";
            }
            else
                out << "/>\n";
        }

        free(it_evt.current());
        ++it_evt;
    }
}
开发者ID:bleakxanadu,项目名称:douml,代码行数:55,代码来源:UmlOperation.cpp

示例14: write

void UmlArtifact::write(FileOut & out)
{
    const char * k = (_uml_20) ? "ownedMember" : "packagedElement";

    out.indent();
    out << "<" << k << " xmi:type=\"uml:Artifact\"";
    out.id(this);
    out << " name=\"";
    out.quote((const char *)name()); //[jasa] ambiguous call
    out << "\">\n";
    out.indent(+1);

    write_description_properties(out);

    const Q3PtrVector<UmlItem> ch = children();
    unsigned i;
    unsigned n = ch.size();
    unsigned rank = 0;

    for (i = 0; i != n; i += 1) {
        UmlItem * x = ch[i];

        if ((x->kind() == aNcRelation) &&
            (x->stereotype() == "manifest") &&
            (((UmlNcRelation *) x)->relationKind() == aDependency))
            write_manifest(out, ((UmlNcRelation *) x)->target(), "dependency", ++rank);
        else
            ch[i]->write(out);
    }

    if (stereotype() == "source") {
        const Q3PtrVector<UmlClass> & cls = associatedClasses();

        n = cls.size();

        for (i = 0; i != n; i += 1)
            write_manifest(out, cls[i], "source", ++rank);
    }
    else {
        const Q3PtrVector<UmlArtifact> & arts = associatedArtifacts();

        n = arts.size();

        for (i = 0; i != n; i += 1)
            write_manifest(out, arts[i], 0, ++rank);
    }

    out.indent(-1);
    out.indent();
    out << "</" << k << ">\n";

    unload();

}
开发者ID:02JanDal,项目名称:douml,代码行数:54,代码来源:UmlArtifact.cpp

示例15: write

void UmlClass::write(FileOut & out)
{
    if (! _written) {
        _written = TRUE;

        // parent already written

        out.indent();
        out << "<UML:Classifier.feature>\n";
        out.indent(+1);
    }
}
开发者ID:ErickCastellanos,项目名称:douml,代码行数:12,代码来源:UmlClass.cpp


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