本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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";
}
示例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';
}