这篇教程C++ writeIndent函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中writeIndent函数的典型用法代码示例。如果您正苦于以下问题:C++ writeIndent函数的具体用法?C++ writeIndent怎么用?C++ writeIndent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了writeIndent函数的23个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: switch void PlainTextWriter::writeValue(std::string &document, const Value &value) { switch(value.type()) { case nullValue: break; case intValue: document += valueToString(value.asLargestInt()); break; case uintValue: document += valueToString(value.asLargestUInt()); break; case realValue: document += valueToString(value.asDouble()); break; case stringValue: document += valueToQuotedString(value.asString().c_str()); break; case booleanValue: document += value.asBool(); break; case arrayValue: { for (uint8_t index = 0; index < value.size(); index++) { switch(value[index].type()) { case nullValue: case intValue: case uintValue: case realValue: case stringValue: case booleanValue: writeIndent(document); writeValue(document, value[index]); document += "/n"; break; case arrayValue: case objectValue: depth++; writeValue(document, value[index]); depth--; break; } } break; } case objectValue: { Value::Members members(value.getMemberNames()); for (Value::Members::iterator it = members.begin(); it != members.end(); ++it) { const std::string &name = *it; writeIndent(document); document += name; document += ":"; switch(value[name].type()) { case nullValue: case intValue: case uintValue: case realValue: case stringValue: case booleanValue: document += " "; writeValue(document, value[name]); document += "/n"; break; case arrayValue: case objectValue: document += "/n"; depth++; writeValue(document, value[name]); depth--; } } break; } } }
开发者ID:gitter-badger,项目名称:dronekit-la,代码行数:74,
示例2: writeIndentvoid StyledWriter::writeWithIndent( const std::string &value ){ writeIndent(); document_ += value;}
开发者ID:Epidilius,项目名称:PhysicsHackAndSlash,代码行数:6,
示例3: writelnvoid writeln(FILE* file, int indentLevel, const char* str){ writeIndent(file, indentLevel); lwrite(file, str); lwrite(file, "/n");}
开发者ID:3ig,项目名称:Xperia-2011-Official-Kernel-Sources,代码行数:6,
示例4: writevoid write(TextStream& ts, const RenderObject& o, int indent, RenderAsTextBehavior behavior){#if ENABLE(SVG) if (o.isSVGPath()) { write(ts, *toRenderSVGPath(&o), indent); return; } if (o.isSVGGradientStop()) { writeSVGGradientStop(ts, *toRenderSVGGradientStop(&o), indent); return; } if (o.isSVGResourceContainer()) { writeSVGResourceContainer(ts, o, indent); return; } if (o.isSVGContainer()) { writeSVGContainer(ts, o, indent); return; } if (o.isSVGRoot()) { write(ts, *toRenderSVGRoot(&o), indent); return; } if (o.isSVGText()) { writeSVGText(ts, *toRenderBlock(&o), indent); return; } if (o.isSVGInlineText()) { writeSVGInlineText(ts, *toRenderText(&o), indent); return; } if (o.isSVGImage()) { writeSVGImage(ts, *toRenderSVGImage(&o), indent); return; }#endif writeIndent(ts, indent); RenderTreeAsText::writeRenderObject(ts, o, behavior); ts << "/n"; if (o.isText() && !o.isBR()) { const RenderText& text = *toRenderText(&o); for (InlineTextBox* box = text.firstTextBox(); box; box = box->nextTextBox()) { writeIndent(ts, indent + 1); writeTextRun(ts, text, *box); } } for (RenderObject* child = o.firstChild(); child; child = child->nextSibling()) { if (child->hasLayer()) continue; write(ts, *child, indent + 1, behavior); } if (o.isWidget()) { Widget* widget = toRenderWidget(&o)->widget(); if (widget && widget->isFrameView()) { FrameView* view = static_cast<FrameView*>(widget); RenderView* root = view->frame()->contentRenderer(); if (root) { view->layout(); RenderLayer* l = root->layer(); if (l) writeLayers(ts, l, l, IntRect(l->x(), l->y(), l->width(), l->height()), indent + 1, behavior); } } }}
开发者ID:DreamOnTheGo,项目名称:src,代码行数:70,
示例5: pushValuevoidStyledStreamWriter::writeArrayValue ( const Value& value ){ unsigned size = value.size (); if ( size == 0 ) pushValue ( "[]" ); else { bool isArrayMultiLine = isMultineArray ( value ); if ( isArrayMultiLine ) { writeWithIndent ( "[" ); indent (); bool hasChildValue = !childValues_.empty (); unsigned index = 0; while ( true ) { const Value& childValue = value[index]; writeCommentBeforeValue ( childValue ); if ( hasChildValue ) writeWithIndent ( childValues_[index] ); else { writeIndent (); writeValue ( childValue ); } if ( ++index == size ) { writeCommentAfterValueOnSameLine ( childValue ); break; } *document_ << ","; writeCommentAfterValueOnSameLine ( childValue ); } unindent (); writeWithIndent ( "]" ); } else // output on a single line { assert ( childValues_.size () == size ); *document_ << "[ "; for ( unsigned index = 0; index < size; ++index ) { if ( index > 0 ) *document_ << ", "; *document_ << childValues_[index]; } *document_ << " ]"; } }}
开发者ID:BitHighlander,项目名称:rippled,代码行数:61,
示例6: writeIndentvoid GraphicsLayer::dumpProperties(TextStream& ts, int indent, LayerTreeAsTextBehavior behavior) const{ if (m_position != FloatPoint()) { writeIndent(ts, indent + 1); ts << "(position " << m_position.x() << " " << m_position.y() << ")/n"; } if (m_boundsOrigin != FloatPoint()) { writeIndent(ts, indent + 1); ts << "(bounds origin " << m_boundsOrigin.x() << " " << m_boundsOrigin.y() << ")/n"; } if (m_anchorPoint != FloatPoint3D(0.5f, 0.5f, 0)) { writeIndent(ts, indent + 1); ts << "(anchor " << m_anchorPoint.x() << " " << m_anchorPoint.y(); if (m_anchorPoint.z()) ts << " " << m_anchorPoint.z(); ts << ")/n"; } if (m_size != IntSize()) { writeIndent(ts, indent + 1); ts << "(bounds " << m_size.width() << " " << m_size.height() << ")/n"; } if (m_opacity != 1) { writeIndent(ts, indent + 1); ts << "(opacity " << m_opacity << ")/n"; }#if ENABLE(CSS_COMPOSITING) if (m_blendMode != BlendModeNormal) { writeIndent(ts, indent + 1); ts << "(blendMode " << compositeOperatorName(CompositeSourceOver, m_blendMode) << ")/n"; }#endif if (m_usingTiledBacking) { writeIndent(ts, indent + 1); ts << "(usingTiledLayer " << m_usingTiledBacking << ")/n"; } bool needsIOSDumpRenderTreeMainFrameRenderViewLayerIsAlwaysOpaqueHack = m_client.needsIOSDumpRenderTreeMainFrameRenderViewLayerIsAlwaysOpaqueHack(*this); if (m_contentsOpaque || needsIOSDumpRenderTreeMainFrameRenderViewLayerIsAlwaysOpaqueHack) { writeIndent(ts, indent + 1); ts << "(contentsOpaque " << (m_contentsOpaque || needsIOSDumpRenderTreeMainFrameRenderViewLayerIsAlwaysOpaqueHack) << ")/n"; } if (m_preserves3D) { writeIndent(ts, indent + 1); ts << "(preserves3D " << m_preserves3D << ")/n"; } if (m_drawsContent && m_client.shouldDumpPropertyForLayer(this, "drawsContent")) { writeIndent(ts, indent + 1); ts << "(drawsContent " << m_drawsContent << ")/n"; } if (!m_contentsVisible) { writeIndent(ts, indent + 1); ts << "(contentsVisible " << m_contentsVisible << ")/n"; } if (!m_backfaceVisibility) { writeIndent(ts, indent + 1); ts << "(backfaceVisibility " << (m_backfaceVisibility ? "visible" : "hidden") << ")/n"; } if (behavior & LayerTreeAsTextDebug) { writeIndent(ts, indent + 1); ts << "(primary-layer-id " << primaryLayerID() << ")/n"; writeIndent(ts, indent + 1); ts << "(client " << static_cast<void*>(&m_client) << ")/n"; } if (m_backgroundColor.isValid() && m_client.shouldDumpPropertyForLayer(this, "backgroundColor")) { writeIndent(ts, indent + 1); ts << "(backgroundColor " << m_backgroundColor.nameForRenderTreeAsText() << ")/n"; } if (!m_transform.isIdentity()) { writeIndent(ts, indent + 1); ts << "(transform "; ts << "[" << m_transform.m11() << " " << m_transform.m12() << " " << m_transform.m13() << " " << m_transform.m14() << "] "; ts << "[" << m_transform.m21() << " " << m_transform.m22() << " " << m_transform.m23() << " " << m_transform.m24() << "] "; ts << "[" << m_transform.m31() << " " << m_transform.m32() << " " << m_transform.m33() << " " << m_transform.m34() << "] "; ts << "[" << m_transform.m41() << " " << m_transform.m42() << " " << m_transform.m43() << " " << m_transform.m44() << "])/n"; } // Avoid dumping the sublayer transform on the root layer, because it's used for geometry flipping, whose behavior // differs between platforms. if (parent() && !m_childrenTransform.isIdentity()) { writeIndent(ts, indent + 1); ts << "(childrenTransform "; ts << "[" << m_childrenTransform.m11() << " " << m_childrenTransform.m12() << " " << m_childrenTransform.m13() << " " << m_childrenTransform.m14() << "] "; ts << "[" << m_childrenTransform.m21() << " " << m_childrenTransform.m22() << " " << m_childrenTransform.m23() << " " << m_childrenTransform.m24() << "] "; ts << "[" << m_childrenTransform.m31() << " " << m_childrenTransform.m32() << " " << m_childrenTransform.m33() << " " << m_childrenTransform.m34() << "] "; ts << "[" << m_childrenTransform.m41() << " " << m_childrenTransform.m42() << " " << m_childrenTransform.m43() << " " << m_childrenTransform.m44() << "])/n"; }//.........这里部分代码省略.........
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:101,
示例7: writeWithIndentvoid StyledStreamWriter::writeWithIndent(const JSONCPP_STRING& value) { if (!indented_) writeIndent(); *document_ << value; indented_ = false;}
开发者ID:151706061,项目名称:jsoncpp,代码行数:5,
示例8: writePointvoid writePoint(FILE* file, int indentLevel, const char* str, SkPoint point){ writeIndent(file, indentLevel); fprintf(file, "%s = { x = %.3f; y = %.3f; };/n", str, point.fX, point.fY);}
开发者ID:abdollatiif,项目名称:android-manet-olsrd,代码行数:5,
示例9: writeSizevoid writeSize(FILE* file, int indentLevel, const char* str, SkSize size){ writeIndent(file, indentLevel); fprintf(file, "%s = { w = %.3f; h = %.3f; };/n", str, size.width(), size.height());}
开发者ID:abdollatiif,项目名称:android-manet-olsrd,代码行数:5,
示例10: switchvoid Decompiler::writeInstruction(Common::WriteStream &out, const Instruction* instruction, size_t indent) { switch (instruction->opcode) { case kOpcodeCONST: { const Variable *v = instruction->variables[0]; writeIndent(out, indent); out.writeString(getVariableTypeName(v->type) + " " + formatVariableName(v) + " = " + formatInstructionData(*instruction) + ";/n"); break; } case kOpcodeACTION: { unsigned int paramCount = instruction->args[1]; writeIndent(out, indent); if (instruction->variables.size() > paramCount) { const Variable *ret = instruction->variables.back(); out.writeString(getVariableTypeName(ret->type, _ncs->getGame()) + " " + formatVariableName(ret) + " = "); } out.writeString(getFunctionName(_ncs->getGame(), instruction->args[0])); out.writeString("("); for (unsigned int i = 0; i < paramCount; ++i) { out.writeString(formatVariableName(instruction->variables[i])); if (i < paramCount - 1) out.writeString(", "); } out.writeString(");/n"); break; } case kOpcodeCPDOWNBP: case kOpcodeCPDOWNSP: case kOpcodeCPTOPBP: case kOpcodeCPTOPSP: { const Variable *v1 = instruction->variables[0]; const Variable *v2 = instruction->variables[1]; writeIndent(out, indent); out.writeString(getVariableTypeName(v2->type, _ncs->getGame()) + " " + formatVariableName(v2) + " = " + formatVariableName(v1) + ";/n"); break; } case kOpcodeLOGAND: { const Variable *v1 = instruction->variables[0]; const Variable *v2 = instruction->variables[1]; const Variable *result = instruction->variables[2]; writeIndent(out, indent); out.writeString( getVariableTypeName(result->type, _ncs->getGame()) + " " + formatVariableName(result) + " = " + formatVariableName(v1) + " && " + formatVariableName(v2) + ";/n" ); break; } case kOpcodeLOGOR: { const Variable *v1 = instruction->variables[0]; const Variable *v2 = instruction->variables[1]; const Variable *result = instruction->variables[2]; writeIndent(out, indent); out.writeString( getVariableTypeName(result->type, _ncs->getGame()) + " " + formatVariableName(result) + " = " + formatVariableName(v1) + " || " + formatVariableName(v2) + ";/n" ); break; } case kOpcodeEQ: { const Variable *v1 = instruction->variables[0]; const Variable *v2 = instruction->variables[1]; const Variable *result = instruction->variables[2]; writeIndent(out, indent); out.writeString( getVariableTypeName(result->type, _ncs->getGame()) + " " + formatVariableName(result) + " = " + formatVariableName(v1) + " == " + formatVariableName(v2) + ";/n" ); break; } case kOpcodeLEQ: { const Variable *v1 = instruction->variables[0]; const Variable *v2 = instruction->variables[1]; const Variable *result = instruction->variables[2]; writeIndent(out, indent); out.writeString( getVariableTypeName(result->type, _ncs->getGame()) + " " + formatVariableName(result) + " = " +//.........这里部分代码省略.........
开发者ID:xoreos,项目名称:xoreos-tools,代码行数:101,
示例11: writeFloatValvoid writeFloatVal(FILE* file, int indentLevel, const char* str, float value){ writeIndent(file, indentLevel); fprintf(file, "%s = %.3f;/n", str, value);}
开发者ID:abdollatiif,项目名称:android-manet-olsrd,代码行数:5,
示例12: writeIndentvoid CCVideoLayerImpl::dumpLayerProperties(TextStream& ts, int indent) const{ writeIndent(ts, indent); ts << "video layer/n"; CCLayerImpl::dumpLayerProperties(ts, indent);}
开发者ID:Moondee,项目名称:Artemis,代码行数:6,
示例13: writeTransUnitsstatic void writeTransUnits(QTextStream &ts, const TranslatorMessage &msg, const QRegExp &drops, int indent){ static int msgid; QString msgidstr = !msg.id().isEmpty() ? msg.id() : QString::fromAscii("_msg%1").arg(++msgid); QStringList translns = msg.translations(); QHash<QString, QString>::const_iterator it; QString pluralStr; QStringList sources(msg.sourceText()); if ((it = msg.extras().find(QString::fromLatin1("po-msgid_plural"))) != msg.extras().end()) sources.append(*it); QStringList oldsources; if (!msg.oldSourceText().isEmpty()) oldsources.append(msg.oldSourceText()); if ((it = msg.extras().find(QString::fromLatin1("po-old_msgid_plural"))) != msg.extras().end()) { if (oldsources.isEmpty()) { if (sources.count() == 2) oldsources.append(QString()); else pluralStr = QLatin1Char(' ') + QLatin1String(attribPlural) + QLatin1String("=/"yes/""); } oldsources.append(*it); } QStringList::const_iterator srcit = sources.begin(), srcend = sources.end(), oldsrcit = oldsources.begin(), oldsrcend = oldsources.end(), transit = translns.begin(), transend = translns.end(); int plural = 0; QString source; while (srcit != srcend || oldsrcit != oldsrcend || transit != transend) { QByteArray attribs; QByteArray state; if (msg.type() == TranslatorMessage::Obsolete) { if (!msg.isPlural()) attribs = " translate=/"no/""; } else if (msg.type() == TranslatorMessage::Finished) { attribs = " approved=/"yes/""; } else if (transit != transend && !transit->isEmpty()) { state = " state=/"needs-review-translation/""; } writeIndent(ts, indent); ts << "<trans-unit id=/"" << msgidstr; if (msg.isPlural()) ts << "[" << plural++ << "]"; ts << "/"" << attribs << ">/n"; ++indent; writeIndent(ts, indent); if (srcit != srcend) { source = *srcit; ++srcit; } // else just repeat last element ts << "<source xml:space=/"preserve/">" << protect(source) << "</source>/n"; bool puttrans = false; QString translation; if (transit != transend) { translation = *transit; translation.replace(QChar(Translator::BinaryVariantSeparator), QChar(Translator::TextVariantSeparator)); ++transit; puttrans = true; } do { if (oldsrcit != oldsrcend && !oldsrcit->isEmpty()) { writeIndent(ts, indent); ts << "<alt-trans>/n"; ++indent; writeIndent(ts, indent); ts << "<source xml:space=/"preserve/"" << pluralStr << '>' << protect(*oldsrcit) << "</source>/n"; if (!puttrans) { writeIndent(ts, indent); ts << "<target restype=/"" << restypeDummy << "/"/>/n"; } } if (puttrans) { writeIndent(ts, indent); ts << "<target xml:space=/"preserve/"" << state << ">" << protect(translation) << "</target>/n"; } if (oldsrcit != oldsrcend) { if (!oldsrcit->isEmpty()) { --indent; writeIndent(ts, indent); ts << "</alt-trans>/n"; } ++oldsrcit; } puttrans = false; } while (srcit == srcend && oldsrcit != oldsrcend); if (!msg.isPlural()) { writeLineNumber(ts, msg, indent); writeComment(ts, msg, drops, indent); } --indent;//.........这里部分代码省略.........
开发者ID:hkahn,项目名称:qt5-qttools-nacl,代码行数:101,
示例14: writeLengthvoid writeLength(FILE* file, int indentLevel, const char* str, SkLength length){ if (!length.defined()) return; writeIndent(file, indentLevel); fprintf(file, "%s = { type = %d; value = %.2f; };/n", str, length.type, length.value);}
开发者ID:abdollatiif,项目名称:android-manet-olsrd,代码行数:6,
示例15: saveXLIFFbool saveXLIFF(const Translator &translator, QIODevice &dev, ConversionData &cd){ bool ok = true; int indent = 0; QTextStream ts(&dev); ts.setCodec(QTextCodec::codecForName("UTF-8")); QStringList dtgs = cd.dropTags(); dtgs << QLatin1String("po-(old_)?msgid_plural"); QRegExp drops(dtgs.join(QLatin1String("|"))); QHash<QString, QHash<QString, QList<TranslatorMessage> > > messageOrder; QHash<QString, QList<QString> > contextOrder; QList<QString> fileOrder; foreach (const TranslatorMessage &msg, translator.messages()) { QString fn = msg.fileName(); if (fn.isEmpty() && msg.type() == TranslatorMessage::Obsolete) fn = QLatin1String(MAGIC_OBSOLETE_REFERENCE); QHash<QString, QList<TranslatorMessage> > &file = messageOrder[fn]; if (file.isEmpty()) fileOrder.append(fn); QList<TranslatorMessage> &context = file[msg.context()]; if (context.isEmpty()) contextOrder[fn].append(msg.context()); context.append(msg); } ts.setFieldAlignment(QTextStream::AlignRight); ts << "<?xml version=/"1.0/""; ts << " encoding=/"utf-8/"?>/n"; ts << "<xliff version=/"1.2/" xmlns=/"" << XLIFF12namespaceURI << "/" xmlns:trolltech=/"" << TrollTsNamespaceURI << "/">/n"; ++indent; writeExtras(ts, indent, translator.extras(), drops); QString sourceLanguageCode = translator.sourceLanguageCode(); if (sourceLanguageCode.isEmpty() || sourceLanguageCode == QLatin1String("C")) sourceLanguageCode = QLatin1String("en"); else sourceLanguageCode.replace(QLatin1Char('_'), QLatin1Char('-')); QString languageCode = translator.languageCode(); languageCode.replace(QLatin1Char('_'), QLatin1Char('-')); foreach (const QString &fn, fileOrder) { writeIndent(ts, indent); ts << "<file original=/"" << fn << "/"" << " datatype=/"" << dataType(messageOrder[fn].begin()->first()) << "/"" << " source-language=/"" << sourceLanguageCode.toLatin1() << "/"" << " target-language=/"" << languageCode.toLatin1() << "/"" << "><body>/n"; ++indent; foreach (const QString &ctx, contextOrder[fn]) { if (!ctx.isEmpty()) { writeIndent(ts, indent); ts << "<group restype=/"" << restypeContext << "/"" << " resname=/"" << protect(ctx) << "/">/n"; ++indent; } foreach (const TranslatorMessage &msg, messageOrder[fn][ctx]) writeMessage(ts, msg, drops, indent); if (!ctx.isEmpty()) { --indent; writeIndent(ts, indent); ts << "</group>/n"; } } --indent; writeIndent(ts, indent); ts << "</body></file>/n"; }
开发者ID:hkahn,项目名称:qt5-qttools-nacl,代码行数:73,
示例16: writeIndentTextStream& SourceAlpha::externalRepresentation(TextStream& ts, int indent) const{ writeIndent(ts, indent); ts << "[SourceAlpha]/n"; return ts;}
开发者ID:achellies,项目名称:WinCEWebKit,代码行数:6,
示例17: writeIndentvoid StyledWriter::writeWithIndent(const JSONCPP_STRING& value) { writeIndent(); document_ += value;}
开发者ID:151706061,项目名称:jsoncpp,代码行数:4,
示例18: writeIndentvoid GraphicsLayer::dumpProperties(TextStream& ts, int indent) const{ writeIndent(ts, indent + 1); ts << "(position " << m_position.x() << " " << m_position.y() << ")/n"; writeIndent(ts, indent + 1); ts << "(anchor " << m_anchorPoint.x() << " " << m_anchorPoint.y() << ")/n"; writeIndent(ts, indent + 1); ts << "(bounds " << m_size.width() << " " << m_size.height() << ")/n"; writeIndent(ts, indent + 1); ts << "(opacity " << m_opacity << ")/n"; writeIndent(ts, indent + 1); ts << "(usingTiledLayer " << m_usingTiledLayer << ")/n"; writeIndent(ts, indent + 1); ts << "(m_preserves3D " << m_preserves3D << ")/n"; writeIndent(ts, indent + 1); ts << "(drawsContent " << m_drawsContent << ")/n"; writeIndent(ts, indent + 1); ts << "(m_backfaceVisibility " << (m_backfaceVisibility ? "visible" : "hidden") << ")/n"; writeIndent(ts, indent + 1); ts << "(client "; if (m_client) ts << static_cast<void*>(m_client); else ts << "none"; ts << ")/n"; writeIndent(ts, indent + 1); ts << "(backgroundColor "; if (!m_backgroundColorSet) ts << "none"; else ts << m_backgroundColor.name(); ts << ")/n"; writeIndent(ts, indent + 1); ts << "(transform "; if (m_transform.isIdentity()) ts << "identity"; else { ts << "[" << m_transform.m11() << " " << m_transform.m12() << " " << m_transform.m13() << " " << m_transform.m14() << "] "; ts << "[" << m_transform.m21() << " " << m_transform.m22() << " " << m_transform.m23() << " " << m_transform.m24() << "] "; ts << "[" << m_transform.m31() << " " << m_transform.m32() << " " << m_transform.m33() << " " << m_transform.m34() << "] "; ts << "[" << m_transform.m41() << " " << m_transform.m42() << " " << m_transform.m43() << " " << m_transform.m44() << "]"; } ts << ")/n"; writeIndent(ts, indent + 1); ts << "(childrenTransform "; if (m_childrenTransform.isIdentity()) ts << "identity"; else { ts << "[" << m_childrenTransform.m11() << " " << m_childrenTransform.m12() << " " << m_childrenTransform.m13() << " " << m_childrenTransform.m14() << "] "; ts << "[" << m_childrenTransform.m21() << " " << m_childrenTransform.m22() << " " << m_childrenTransform.m23() << " " << m_childrenTransform.m24() << "] "; ts << "[" << m_childrenTransform.m31() << " " << m_childrenTransform.m32() << " " << m_childrenTransform.m33() << " " << m_childrenTransform.m34() << "] "; ts << "[" << m_childrenTransform.m41() << " " << m_childrenTransform.m42() << " " << m_childrenTransform.m43() << " " << m_childrenTransform.m44() << "]"; } ts << ")/n"; if (m_replicaLayer) { writeIndent(ts, indent + 1); ts << "(replica layer " << m_replicaLayer << ")/n"; m_replicaLayer->dumpLayer(ts, indent+2); } if (m_replicatedLayer) { writeIndent(ts, indent + 1); ts << "(replicated layer " << m_replicatedLayer << ")/n"; } if (m_children.size()) { writeIndent(ts, indent + 1); ts << "(children " << m_children.size() << "/n"; unsigned i; for (i = 0; i < m_children.size(); i++) m_children[i]->dumpLayer(ts, indent+2); writeIndent(ts, indent + 1); ts << ")/n"; }}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:88,
示例19: writeWithIndentvoid StyledStreamWriter::writeWithIndent(const std::string& value) { if (!indented_) writeIndent(); *document_ << value; indented_ = false;}
开发者ID:robsonswiss,项目名称:OSVR-user-settings,代码行数:5,
示例20: writeLayersstatic void writeLayers(TextStream& ts, const RenderLayer* rootLayer, RenderLayer* l, const IntRect& paintRect, int indent, RenderAsTextBehavior behavior){ // FIXME: Apply overflow to the root layer to not break every test. Complete hack. Sigh. IntRect paintDirtyRect(paintRect); if (rootLayer == l) { paintDirtyRect.setWidth(max(paintDirtyRect.width(), rootLayer->renderBox()->maxXLayoutOverflow())); paintDirtyRect.setHeight(max(paintDirtyRect.height(), rootLayer->renderBox()->maxYLayoutOverflow())); l->setWidth(max(l->width(), l->renderBox()->maxXLayoutOverflow())); l->setHeight(max(l->height(), l->renderBox()->maxYLayoutOverflow())); } // Calculate the clip rects we should use. IntRect layerBounds, damageRect, clipRectToApply, outlineRect; l->calculateRects(rootLayer, paintDirtyRect, layerBounds, damageRect, clipRectToApply, outlineRect, true); // Ensure our lists are up-to-date. l->updateZOrderLists(); l->updateNormalFlowList(); bool shouldPaint = (behavior & RenderAsTextShowAllLayers) ? true : l->intersectsDamageRect(layerBounds, damageRect, rootLayer); Vector<RenderLayer*>* negList = l->negZOrderList(); bool paintsBackgroundSeparately = negList && negList->size() > 0; if (shouldPaint && paintsBackgroundSeparately) write(ts, *l, layerBounds, damageRect, clipRectToApply, outlineRect, LayerPaintPhaseBackground, indent, behavior); if (negList) { int currIndent = indent; if (behavior & RenderAsTextShowLayerNesting) { writeIndent(ts, indent); ts << " negative z-order list(" << negList->size() << ")/n"; ++currIndent; } for (unsigned i = 0; i != negList->size(); ++i) writeLayers(ts, rootLayer, negList->at(i), paintDirtyRect, currIndent, behavior); } if (shouldPaint) write(ts, *l, layerBounds, damageRect, clipRectToApply, outlineRect, paintsBackgroundSeparately ? LayerPaintPhaseForeground : LayerPaintPhaseAll, indent, behavior); if (Vector<RenderLayer*>* normalFlowList = l->normalFlowList()) { int currIndent = indent; if (behavior & RenderAsTextShowLayerNesting) { writeIndent(ts, indent); ts << " normal flow list(" << normalFlowList->size() << ")/n"; ++currIndent; } for (unsigned i = 0; i != normalFlowList->size(); ++i) writeLayers(ts, rootLayer, normalFlowList->at(i), paintDirtyRect, currIndent, behavior); } if (Vector<RenderLayer*>* posList = l->posZOrderList()) { int currIndent = indent; if (behavior & RenderAsTextShowLayerNesting) { writeIndent(ts, indent); ts << " positive z-order list(" << posList->size() << ")/n"; ++currIndent; } for (unsigned i = 0; i != posList->size(); ++i) writeLayers(ts, rootLayer, posList->at(i), paintDirtyRect, currIndent, behavior); }}
开发者ID:DreamOnTheGo,项目名称:src,代码行数:62,
示例21: writeSVGInlineTextBoxstatic inline void writeSVGInlineTextBox(TextStream& ts, SVGInlineTextBox* textBox, int indent){ SVGRootInlineBox* rootBox = textBox->svgRootInlineBox(); if (!rootBox) return; Vector<SVGTextChunk>& chunks = const_cast<Vector<SVGTextChunk>& >(rootBox->svgTextChunks()); Vector<SVGTextChunk>::iterator it = chunks.begin(); Vector<SVGTextChunk>::iterator end = chunks.end(); // Write text chunks unsigned int i = 1; for (; it != end; ++it) { SVGTextChunk& cur = *it; // Write inline box character ranges Vector<SVGInlineBoxCharacterRange>::iterator boxIt = cur.boxes.begin(); Vector<SVGInlineBoxCharacterRange>::iterator boxEnd = cur.boxes.end(); if (!containsInlineTextBox(cur, textBox)) { i++; continue; } writeIndent(ts, indent + 1); unsigned int j = 1; ts << "chunk " << i << " "; if (cur.anchor == TA_MIDDLE) { ts << "(middle anchor"; if (cur.isVerticalText) ts << ", vertical"; ts << ") "; } else if (cur.anchor == TA_END) { ts << "(end anchor"; if (cur.isVerticalText) ts << ", vertical"; ts << ") "; } else if (cur.isVerticalText) ts << "(vertical) "; unsigned int totalOffset = 0; for (; boxIt != boxEnd; ++boxIt) { SVGInlineBoxCharacterRange& range = *boxIt; unsigned int offset = range.endOffset - range.startOffset; ASSERT(cur.start + totalOffset <= cur.end); totalOffset += offset; if (textBox != static_cast<SVGInlineTextBox*>(range.box)) { j++; continue; } FloatPoint topLeft = topLeftPositionOfCharacterRange(cur.start + totalOffset - offset, cur.start + totalOffset); ts << "text run " << j << " at (" << topLeft.x() << "," << topLeft.y() << ") "; ts << "startOffset " << range.startOffset << " endOffset " << range.endOffset; if (cur.isVerticalText) ts << " height " << cummulatedHeightOfInlineBoxCharacterRange(range); else ts << " width " << cummulatedWidthOfInlineBoxCharacterRange(range); if (textBox->direction() == RTL || textBox->m_dirOverride) { ts << (textBox->direction() == RTL ? " RTL" : " LTR"); if (textBox->m_dirOverride) ts << " override"; } ts << ": " << quoteAndEscapeNonPrintables(String(textBox->textRenderer()->text()).substring(textBox->start() + range.startOffset, offset)) << "/n"; j++; } i++; }}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:83,
示例22: fbool MetaTranslator::saveXLIFF( const QString& filename) const{ QFile f( filename ); if ( !f.open(QIODevice::WriteOnly | QIODevice::Text) ) return false; int indent = 2; int currentindent = 0; QTextStream t( &f ); t.setCodec( QTextCodec::codecForName("ISO-8859-1") ); QMap<QString, TranslatorMessage> mtSortByFileName; TMM::ConstIterator m = mm.begin(); while ( m != mm.end() ) { TranslatorMessage msg = m.key(); QString location = msg.fileName() + QLatin1String(msg.context()) + QString::number(msg.lineNumber()); mtSortByFileName.insertMulti(location, msg); ++m; } t.setFieldAlignment(QTextStream::AlignRight); t << "<?xml version=/"1.0/""; t << " encoding=/"utf-8/"?>/n"; t << "<xliff version=/"1.1/" xmlns=/"" << XLIFF11namespaceURI << "/">/n"; currentindent += indent; QMap<QString, TranslatorMessage>::iterator mi = mtSortByFileName.begin(); TranslatorMessage msg; QByteArray ctx; QString fn; bool ctxdiffer = false; bool filediffer = false; while (mi != mtSortByFileName.end()) { msg = mi.value(); ctxdiffer = msg.context() != ctx; filediffer = msg.fileName() != fn; if (ctxdiffer || filediffer) { if (!ctx.isEmpty()) { writeIndent(&t, currentindent); t << "</group>/n"; currentindent -= indent; } } if (filediffer) { if (!fn.isEmpty()) { writeIndent(&t, currentindent); t << "</body></file>/n"; currentindent -= indent; } fn = msg.fileName(); writeIndent(&t, currentindent); t << "<file original=/"" << fn << "/"" << " datatype=/"" << dataType(msg) << "/"" << " source-language=/"" << "en" << "/"" //### << " target-language=/"" << languageCode() << "/"" << "><body>/n"; currentindent += indent; } if (ctxdiffer || filediffer) { ctx = msg.context(); writeIndent(&t, currentindent); t << "<group restype=/"" << restypeContext << "/"" << " resname=/"" << evilBytes(ctx, msg.utf8()) << "/"" << ">/n"; currentindent += indent; } writeMessage(&t, msg, currentindent, m_language); ++mi; } currentindent-=indent; writeIndent(&t, currentindent); t << "</group>/n"; currentindent-=indent; writeIndent(&t, currentindent); t << "</body></file>/n"; t << "</xliff>/n"; f.close(); return true;}
开发者ID:FilipBE,项目名称:qtextended,代码行数:86,
示例23: writeHexValvoid writeHexVal(FILE* file, int indentLevel, const char* str, int value){ writeIndent(file, indentLevel); fprintf(file, "%s = %x;/n", str, value);}
开发者ID:3ig,项目名称:Xperia-2011-Official-Kernel-Sources,代码行数:5,
注:本文中的writeIndent函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ writeInt函数代码示例 C++ writeImage函数代码示例 |