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


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

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


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

示例1: 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

示例2: write

void UmlOpaqueAction::write(FileOut & out) {
  write_begin(out, "OpaqueAction");
  write_end(out, TRUE);
  
  Q3CString body;
  
  switch(_lang) {
  case Uml:
    body = behavior();
    break;
  case Cpp:
    body = cppBehavior();
    break;
  default:
    // Java
    body = javaBehavior();
  }

  if (!body.isEmpty()) {
    out.indent();
    out << "<body>";
    out.quote(body);
    out << "</body>\n";
  }

  write_close(out);

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

示例3: 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

示例4: 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

示例5: 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

示例6: write

void UmlFormalParameter::write(FileOut & out, UmlClass * cl, int rank, bool uml20) const {
  out.indent();
  out << "<parameter";
  out.idref_prefix(cl, "TEMPLPARAM", rank);
  out << "/>\n";
  out.indent();
  out << "<ownedParameter xmi:type=\"uml:ClassifierTemplateParameter\"";
  out.id_prefix(cl, "TEMPLPARAM", rank);
  out << ">\n";
  out.indent(+1);

  out.indent();
  if (uml20)
    out << "<ownedElement xmi:type=\"uml:Class\"";
  else
    out << "<ownedParameteredElement xmi:type=\"uml:Class\"";
  out.id_prefix(cl, "TEMPLELEM", rank);
  out << " name=\"";
  out.quote(name());
  out << '"';
  out.ref(cl, "templateParameter", "TEMPLPARAM", rank);
  out << "/>\n";

  if (defaultValue().type != 0)
    UmlItem::write_default_value(out, defaultValue().type->name(), cl, rank);
  else
    UmlItem::write_default_value(out, defaultValue().explicit_type, cl, rank);

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

示例7: 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

示例8: write_end

void UmlActivityAction::write_end(FileOut & out, bool dontclose) {
  out << ">\n";
  out.indent(+1);
  
  Q3CString s = constraint();
  
  if (! s.isEmpty()) {
    out.indent();
    out << "<ownedRule xmi:type=\"uml:Constraint\"";
    out.id_prefix(this, "CONSTRAINT_");
    out.ref(this, "constrainedElement");
    out << ">\n";
    out.indent();
    out << "\t<specification xmi:type=\"uml:OpaqueExpression\"";
    out.id_prefix(this, "CSPEC_");
    out << ">\n";
    out.indent();
    out << "\t\t<body>";
    out.quote(s);
    out << "</body>\n";
    out.indent();
    out << "\t</specification>\n";
    out.indent();
    out << "</ownedRule>\n";
  }
  
  write_description_properties(out);

  switch (_lang) {
  case Uml:
    write_condition(out, preCondition(), TRUE);
    write_condition(out, postCondition(), FALSE);
    break;
  case Cpp:
    write_condition(out, cppPreCondition(), TRUE);
    write_condition(out, cppPostCondition(), FALSE);
    break;
  default:
    // java
    write_condition(out, javaPreCondition(), TRUE);
    write_condition(out, javaPostCondition(), FALSE);
  }

  const Q3PtrVector<UmlItem> ch = children();
  unsigned n = ch.size();
  
  for (unsigned i = 0; i != n; i += 1)
    ch[i]->write(out);

  write_incoming_flows(out);
  
  if (!dontclose)
    write_close(out);
}
开发者ID:SciBoy,项目名称:douml,代码行数:54,代码来源:UmlActivityAction.cpp

示例9: write_begin

void UmlActivityAction::write_begin(FileOut & out, Q3CString k) {
  out.indent();
  out << ((parent()->kind() == anActivity) ? "<node" : "<containedNode")
    << " xmi:type=\"uml:" << k << '"';
  out.id(this);
  if (!name().isEmpty()){
    out << " name=\"";
    out.quote(name());
    out << '"';
  }
}
开发者ID:SciBoy,项目名称:douml,代码行数:11,代码来源:UmlActivityAction.cpp

示例10: write_stereotype

void UmlItem::write_stereotype(FileOut & out)
{
    if (! stereotype().isEmpty()) {
        out.indent();
        out << "<UML:ModelElement.stereotype>\n";
        out.indent();
        out << "\t<UML:Stereotype name=\"";
        out.quote(stereotype());
        out << "\"/>\n";
        out.indent();
        out << "</UML:ModelElement.stereotype>\n";

        switch (_taggedvalue_mode) {
        case 1:
            out.indent();
            out << "<UML:ModelElement.taggedValue>\n";
            out.indent();
            out << "\t<UML:TaggedValue tag=\"stereotype\" value=\"";
            out.quote(stereotype());
            out << "\"/>\n";
            out.indent();
            out << "</UML:ModelElement.taggedValue>\n";
            break;

        case 2:
            out.indent();
            out << "<UML:ModelElement.taggedValue>\n";
            out.indent();
            out << "\t<UML:TaggedValue.tag>stereotype</UML:TaggedValue.tag>\n";
            out.indent();
            out << "\t<UML:TaggedValue.value>";
            out.quote(stereotype());
            out << "</UML:TaggedValue.value>\n";
            out.indent();
            out << "</UML:ModelElement.taggedValue>\n";
        }
    }

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

示例11: write

void UmlActivityObject::write(FileOut & out)
{
    const char * k = (parent()->kind() == anActivity)
                     ? "node" : "containedNode";

    out.indent();
    out << '<' << k << " xmi:type=\"uml:";

    WrapperStr st = stereotype();

    if (st == "datastore")
        out << "DataStoreNode";
    else if (st == "centralBuffer")
        out << "CentralBufferNode";
    else
        out << "ObjectNode";

    out << "\" name=\"";
    out.quote(name());
    out << '"';
    out.id(this);

    if (isControlType())
        out << " isControlType=\"true\"";

    write_ordering(out);
    write_selection(out);
    write_in_state(out);
    out << ">\n";

    out.indent(+1);

    write_description_properties(out);
    write_multiplicity(out, multiplicity(), this);
    UmlItem::write_type(out, type());

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

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

    write_incoming_flows(out);

    out.indent(-1);

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

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

示例12: write_description_properties

void UmlItem::write_description_properties(FileOut & out)
{
    if (_taggedvalue_mode != 0) {
        if (! description().isEmpty()) {
            out.indent();
            out << "<UML:ModelElement.taggedValue>\n";
            out.indent();

            if (_taggedvalue_mode == 1) {
                out << "\t<UML:TaggedValue tag=\"documentation\" value=\"";
                out.quote(description());
                out << "\"/>\n";
            }
            else {
                out << "\t<UML:TaggedValue.tag>documentation</UML:TaggedValue.tag>\n";
                out.indent();
                out << "\t<UML:TaggedValue.value>";
                out.quote(description());
                out << "</UML:TaggedValue.value>\n";
            }

            out.indent();
            out << "</UML:ModelElement.taggedValue>\n";
        }

        const QHash<QByteArray, QByteArray*> up = properties();
        QHashIterator<QByteArray, QByteArray*> it(up);

        while (it.hasNext()) {
            it.next();
            out.indent();
            out << "<UML:ModelElement.taggedValue>\n";
            out.indent();

            if (_taggedvalue_mode == 1) {
                out << "\t<UML:TaggedValue tag=\"";
                out.quote(it.key());
                out << "\" value=\"";
                out.quote(*(it.value()));
                out << "\"/>\n";
            }
            else {
                out << "\t<UML:TaggedValue.tag>";
                out.quote(it.key());
                out << "</UML:TaggedValue.tag>\n";
                out.indent();
                out << "\t<UML:TaggedValue.value>";
                out.quote(*(it.value()));
                out << "</UML:TaggedValue.value>\n";
            }

            out.indent();
            out << "</UML:ModelElement.taggedValue>\n";
//            ++it;
        }
    }
}
开发者ID:ErickCastellanos,项目名称:douml,代码行数:57,代码来源:UmlItem.cpp

示例13: write_description_properties

void UmlItem::write_description_properties(FileOut & out)
{
    if (_taggedvalue_mode != 0) {
        if (! description().isEmpty()) {
            out.indent();
            out << "<UML:ModelElement.taggedValue>\n";
            out.indent();

            if (_taggedvalue_mode == 1) {
                out << "\t<UML:TaggedValue tag=\"documentation\" value=\"";
                out.quote(description());
                out << "\"/>\n";
            }
            else {
                out << "\t<UML:TaggedValue.tag>documentation</UML:TaggedValue.tag>\n";
                out.indent();
                out << "\t<UML:TaggedValue.value>";
                out.quote(description());
                out << "</UML:TaggedValue.value>\n";
            }

            out.indent();
            out << "</UML:ModelElement.taggedValue>\n";
        }

        const Q3Dict<Q3CString> up = properties();
        Q3DictIterator<Q3CString> it(up);

        while (it.current()) {
            out.indent();
            out << "<UML:ModelElement.taggedValue>\n";
            out.indent();

            if (_taggedvalue_mode == 1) {
                out << "\t<UML:TaggedValue tag=\"";
                out.quote(it.currentKey());
                out << "\" value=\"";
                out.quote(*(it.current()));
                out << "\"/>\n";
            }
            else {
                out << "\t<UML:TaggedValue.tag>";
                out.quote(it.currentKey());
                out << "</UML:TaggedValue.tag>\n";
                out.indent();
                out << "\t<UML:TaggedValue.value>";
                out.quote(*(it.current()));
                out << "</UML:TaggedValue.value>\n";
            }

            out.indent();
            out << "</UML:ModelElement.taggedValue>\n";
            ++it;
        }
    }
}
开发者ID:bleakxanadu,项目名称:douml,代码行数:56,代码来源:UmlItem.cpp

示例14: write_default_value

void UmlItem::write_default_value(FileOut & out, Q3CString v, UmlItem * who, int rank)
{
  if (! v.isEmpty()) {
    if (v[0] == '=') {
      v = v.mid(1);
      if (v.isEmpty())
	return;
    }

    out.indent();
    out << "<defaultValue xmi:type=\"uml:LiteralString\"";
    if (rank == -1)
      out.id_prefix(who, "VALUE_");
    else
      out.id_prefix(who, "VALUE", rank);
    out << " value=\"";
    out.quote((const char*)v);//[jasa] ambiguous call
    out << "\"/>\n";
  }
}
开发者ID:SciBoy,项目名称:douml,代码行数:20,代码来源:UmlItem.cpp

示例15: write_signal

void UmlOnSignalAction::write_signal(FileOut & out) {
  Q3CString sig;
  
  switch (_lang) {
  case Uml:
    sig = signal();
    break;
  case Cpp:
    sig = cppSignal();
    break;
  default:
    // java
    sig = javaSignal();
  }

  if (! sig.isEmpty()) {
    out.indent();
    out << "<signal xmi:type=\"uml:Signal\"";
    out.id_prefix(this, "SIGNAL_");
    out << " name=\"";
    out.quote(sig);
    out << "\"/>\n";
  }
}
开发者ID:SciBoy,项目名称:douml,代码行数:24,代码来源:UmlOnSignalAction.cpp


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