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


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

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


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

示例1: fullDebug

void PointerType::fullDebug(StringBuilder& buffer, int indent) const {
    buffer.indent(indent);
    buffer.setColor(COL_STMT);
    buffer << "[PointerType] " << (void*)this << '\n';
    buffer.indent(indent);
    buffer.setColor(COL_ATTR);
    buffer << "pointee=\n";
    PointeeType.fullDebug(buffer, indent+INDENT);
    Type::fullDebug(buffer, indent);
}
开发者ID:hbarve1,项目名称:c2compiler,代码行数:10,代码来源:Type.cpp

示例2: print

void ExplicitCastExpr::print(StringBuilder& buffer, unsigned indent) const {
    buffer.indent(indent);
    buffer.setColor(COL_EXPR);
    buffer << "ExplicitCastExpr ";
    Expr::print(buffer, 0);
    buffer << '\n';
    buffer.setColor(COL_ATTR);
    buffer.indent(indent + INDENT);
    buffer << "DEST: ";
    destType.print(buffer);
    buffer << '\n';
    inner->print(buffer, indent + INDENT);
}
开发者ID:hbarve1,项目名称:c2compiler,代码行数:13,代码来源:Expr.cpp

示例3: write

void DepGenerator::write(const std::string& title, const std::string& path) const {

    int indent = 0;
    StringBuilder output;
    output << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
    output << "<dsm name='" << title << "'>\n";
    indent += INDENT;
    output.indent(indent);
    output << "<model>\n";

    indent += INDENT;
    for (unsigned i=0; i<modules.size(); i++) {
        const ModInfo* P = modules[i];
        output.indent(indent);
        output << "<group name='" << P->name << "' full='module:" << P->name << "' collapsed='1'>\n";
        indent += INDENT;

        for (unsigned j=0; j<P->files.size(); j++) {
            const DepFile* F = P->files[j];
            if (showFiles) {
                output.indent(indent);
                const char* fname = getFileName(F->name);
                output << "<group name='" << fname << "' full='file:" << F->name << "' collapsed='1'>\n";
                indent += INDENT;
            }

            writeAST(F->ast, output, indent);

            if (showFiles) {
                indent -= INDENT;
                output.indent(indent);
                output << "</group>\n";
            }
        }

        indent -= INDENT;
        output.indent(indent);
        output << "</group>\n";
    }
    if (showExternals) {
        output.indent(indent);
        output << "<group name='Externals' full='Externals' collapsed='1'>\n";
        indent += INDENT;
        for (unsigned i=0; i<externals.size(); i++) {
            writeExternal(externals[i], output, indent);
        }
        indent -= INDENT;
        output.indent(indent);
        output << "</group>\n";
    }
    indent -= INDENT;

    output.indent(indent);
    output << "</model>\n";
    indent -= INDENT;
    output << "</dsm>\n";

    FileUtils::writeFile(path.c_str(), path + "deps.xml", output);
}
开发者ID:hbarve1,项目名称:c2compiler,代码行数:59,代码来源:DepGenerator.cpp

示例4: fullDebug

void QualType::fullDebug(StringBuilder& buffer, int indent) const {
    buffer.indent(indent);
    buffer.setColor(COL_EXPR);
    buffer << "[QualType] " << (void*)this;
    buffer.setColor(COL_ATTR);
    buffer << " qualifiers=";
    printQualifiers(buffer);
    buffer << '\n';
    if (isNull()) {
        buffer.indent(indent);
        buffer.setColor(ANSI_RED);
        buffer << "type=NULL\n";
    } else {
        getTypePtr()->fullDebug(buffer, indent);
    }
}
开发者ID:DawidvC,项目名称:c2compiler,代码行数:16,代码来源:Type.cpp

示例5: fullDebugImpl

void FunctionType::fullDebugImpl(StringBuilder& buffer, int indent) const {
    buffer.indent(indent);
    buffer.setColor(COL_STMT);
    buffer << "[FunctionType] " << (void*)this << '\n';
    buffer << "TODO\n";
    Type::fullDebugImpl(buffer, indent);
}
开发者ID:DawidvC,项目名称:c2compiler,代码行数:7,代码来源:Type.cpp

示例6: fullDebug

void EnumType::fullDebug(StringBuilder& buffer, int indent) const {
    buffer.indent(indent);
    buffer.setColor(COL_STMT);
    buffer << "[EnumType] " << (void*)this << '\n';
    buffer << "TODO\n";
    Type::fullDebug(buffer, indent);
}
开发者ID:Davidbrcz,项目名称:c2compiler,代码行数:7,代码来源:Type.cpp

示例7: writeExternal

void DepGenerator::writeExternal(const Module* P, StringBuilder& output, unsigned indent) const {
    output.indent(indent);
    output << "<group name='" << P->getName() << "' full='module:" << P->getName() << "' collapsed='1'>\n";
    indent += INDENT;

    const Module::Symbols& symbols = P->getSymbols();
    for (Module::SymbolsConstIter iter=symbols.begin(); iter!=symbols.end(); ++iter) {
        const Decl* D = iter->second;
        output.indent(indent);
        output << "<atom name='" << D->getName();
        if (isa<FunctionDecl>(D)) output << "()";
        output << "' full='";
        fullName(D, output);
        output << "' />\n";
    }

    indent -= INDENT;
    output.indent(indent);
    output << "</group>\n";
}
开发者ID:hbarve1,项目名称:c2compiler,代码行数:20,代码来源:DepGenerator.cpp

示例8: print

void MemberExpr::print(StringBuilder& buffer, unsigned indent) const {
    buffer.indent(indent);
    buffer.setColor(COL_EXPR);
    buffer << "MemberExpr";
    buffer.setColor(COL_ATTR);
    if (isModulePrefix()) buffer << " mod-prefix";
    buffer << ' ';
    Expr::print(buffer, 0);
    buffer << '\n';
    Base->print(buffer, indent + INDENT);
    member->print(buffer, indent + INDENT);
    buffer.indent(indent + INDENT);
    buffer.setColor(COL_ATTR);
    buffer << "decl=";
    if (decl) {
        buffer << decl->getName();
    } else {
        buffer.setColor(ANSI_RED);
        buffer << "NULL";
    }
    buffer << '\n';
}
开发者ID:Davidbrcz,项目名称:c2compiler,代码行数:22,代码来源:Expr.cpp


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