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


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

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


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

示例1: print

void DesignatedInitExpr::print(StringBuilder& buffer, unsigned indent) const {
    buffer.indent(indent);
    buffer.setColor(COL_EXPR);
    buffer << "DesignatedInitExpr ";
    Expr::print(buffer, 0);
    if (getDesignatorKind() == ARRAY_DESIGNATOR) {
        buffer << " array";
    } else {
        buffer << " field";
    }
    buffer << '\n';
    buffer.indent(indent);
    buffer.setColor(COL_ATTR);
    if (getDesignatorKind() == ARRAY_DESIGNATOR) {
        buffer << "Designator = [" << index.getSExtValue() << "]\n";
        designator->print(buffer, indent + INDENT);
    } else {
        buffer << "field = ";
        buffer.setColor(COL_VALUE);
        buffer << '\'' << field << '\'' << '\n';
    }
    buffer.indent(indent);
    buffer.setColor(COL_ATTR);
    buffer << "InitValue=\n";
    initValue->print(buffer, indent + INDENT);
}
开发者ID:hbarve1,项目名称:c2compiler,代码行数:26,代码来源:Expr.cpp

示例2: fullDebugImpl

void PointerType::fullDebugImpl(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::fullDebugImpl(buffer, indent);
}
开发者ID:DawidvC,项目名称:c2compiler,代码行数:10,代码来源:Type.cpp

示例3: debugPrint

void QualType::debugPrint(StringBuilder& buffer) const {
    if (isNull()) {
        buffer.setColor(ANSI_RED);
        buffer << "??";
        buffer.setColor(ANSI_NORMAL);
    } else {
        printQualifiers(buffer);
        getTypePtr()->debugPrint(buffer);
    }
}
开发者ID:DawidvC,项目名称:c2compiler,代码行数:10,代码来源:Type.cpp

示例4: print

void QualType::print(StringBuilder& buffer) const {
    buffer.setColor(COL_TYPE);
    buffer << '\'';
    debugPrint(buffer);
    buffer << '\'';
    const Type* T = getTypePtrOrNull();
    if (T && T != T->canonicalType.getTypePtrOrNull()) {
        buffer.setColor(COL_CANON);
        buffer << "=>";
        getCanonicalType().debugPrint(buffer);
    }
}
开发者ID:hbarve1,项目名称:c2compiler,代码行数:12,代码来源:Type.cpp

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

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

void Type::debugPrint(StringBuilder& buffer) const {
    // only used to print canonical type (called by Sub-Class::debugPrint())
    buffer << "  canonical=";
    if (canonicalType.isNull()) {
        buffer.setColor(ANSI_RED);
        buffer << "???";
    } else {
        const Type* Canon = canonicalType.getTypePtr();
        buffer.setColor(COL_ATTR);
        if (Canon == this) {
            buffer << "this";
        } else {
            Canon->printName(buffer);
        }
    }
    buffer << '\n';
}
开发者ID:Davidbrcz,项目名称:c2compiler,代码行数:17,代码来源:Type.cpp

示例8: debugPrint

void UnresolvedType::debugPrint(StringBuilder& buffer) const {
    if (decl) {
        buffer << "(Unresolved)" << decl->getName();
    } else {
        buffer.setColor(ANSI_RED);
        printLiteral(buffer);
    }
}
开发者ID:hbarve1,项目名称:c2compiler,代码行数:8,代码来源:Type.cpp


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