• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ printIndent函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中printIndent函数的典型用法代码示例。如果您正苦于以下问题:C++ printIndent函数的具体用法?C++ printIndent怎么用?C++ printIndent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: printIndent

void SParts::dumpODEInfo(int level)
{
	printIndent(level);
	printf("*** %s ***\n", m_name.c_str());

	printIndent(level+1);
	printf("m_odeobj=(0x%0p)\n", m_odeobj);
	if (!m_odeobj) printf("+++++ ERROR! m_odeobj=NULL! +++++\n");

	const dReal *pos = getPosition();
	printIndent(level+1);
	printf("pos=(%f, %f, %f)\n", pos[0], pos[1], pos[2]);

	const dReal *q = getQuaternion();
	printIndent(level+1);
	printf("q=(%f, %f, %f, %f)\n", q[0], q[1], q[2], q[3]);

	ChildC::iterator i;
	for (i=m_children.begin(); i!=m_children.end(); i++) {
		Child *c = *i;
		if (c) {
			SParts *childP = c->nextp;
			if (childP) childP->dumpODEInfo(level+2);
		}
	}
}
开发者ID:SIGVerse,项目名称:SIGServer,代码行数:26,代码来源:SParts.cpp


示例2: serialize

	virtual void serialize(std::stringstream& ss, size_t indentLevel) const
	{	
		ss << "[";
		if (indentLevel > 0)
		{
			ss << "\n";
		}
		else
		{
			printIndent(ss, indentLevel);
		}

		for (size_t i=1; i < data.size(); ++i)
		{
			printIndent(ss, indentLevel+1);
			data[i-1]->serialize(ss, indentLevel+1);
			ss << ",\n";
		}
		if (data.size() > 0)
		{
			printIndent(ss, indentLevel+1);
			data[size() - 1]->serialize(ss, indentLevel+1);
		}

		ss << "\n";
		printIndent(ss, indentLevel);
		ss << "]";
	}
开发者ID:wallace-luo,项目名称:EasyJson,代码行数:28,代码来源:EasyJson.cpp


示例3: printIndent

bool ASTPrintVisitor::visit_while(AST_While* node) {
    stream << "while ";
    node->test->accept(this);
    stream << "\n";

    indent += 4;
    for (int i = 0; i < node->body.size(); i++) {
        printIndent();
        node->body[i]->accept(this);
        stream << "\n";
    }
    indent -= 4;

    if (node->orelse.size()) {
        printIndent();
        stream << "else\n";
        indent += 4;
        for (int i = 0; i < node->orelse.size(); i++) {
            printIndent();
            node->orelse[i]->accept(this);
            stream << "\n";
        }
        indent -= 4;
    }
    return true;
}
开发者ID:Daetalus,项目名称:pyston,代码行数:26,代码来源:ast.cpp


示例4: serialize

	virtual void serialize(std::stringstream& ss, size_t indentLevel) const
	{
		if (indentLevel > 0)
		{
			ss << "\n";
		}
		printIndent(ss, indentLevel);
		ss << "{\n";
		for (auto i = data.begin(); i < data.end() - 1; ++i)
		{
			printIndent(ss, indentLevel + 1);
			ss << '"' << i->first.asSTLString() << "\" : ";
			i->second->serialize(ss, indentLevel + 1);
			ss << ",\n";
		}
		if (data.size() > 0)
		{
			auto last = data.end() - 1;
			printIndent(ss, indentLevel + 1);
			ss << '"' << last->first.asSTLString() << "\" : ";
			last->second->serialize(ss, indentLevel + 1);
		}
		ss << "\n";
		printIndent(ss, indentLevel);
		ss << "}";
	}
开发者ID:heleifz,项目名称:EzJson,代码行数:26,代码来源:ezjson.cpp


示例5: printTerm

/** Print the alternatives of a @a Term
	@param term The @a Term to print
*/
static void printTerm(Term *term) {
	int i;
	Alternative *alternative;
	for (i = 0; i < listSize(term->rule); i++) {
		alternative = (Alternative *) listIndex(term->rule, i);
		if (listSize(term->rule) != 1)
			printSet("Alternative on", alternative->first);
		if (alternative->flags & ALTERNATIVE_PREFER) {
			printIndent();
			fputs("%prefer\n", printRuleOutput);
		}
		if (alternative->flags & ALTERNATIVE_AVOID) {
			printIndent();
			fputs("%avoid\n", printRuleOutput);
		}
		if (alternative->flags & ALTERNATIVE_IF) {
			printIndent();
			fprintf(printRuleOutput, "%%if %s\n", alternative->expression->text);
		}
		if (alternative->flags & ALTERNATIVE_DEFAULT && listSize(term->rule) != 1) {
			printIndent();
			fputs("%default\n", printRuleOutput);
		}
	
		printAlternative(alternative);
		if (i < listSize(term->rule) - 1) {
			indent--;
			printIndent();
			fputs("|\n", printRuleOutput);
			indent++;
		}
	}
}
开发者ID:guilhermealles,项目名称:cclabs,代码行数:36,代码来源:printInput.c


示例6: printOutAlias

static void printOutAlias(FILE *out,  UConverter *converter, UResourceBundle *parent, Resource r, const char *key, int32_t indent, const char *pname, UErrorCode *status) {
    static const UChar cr[] = { '\n' };
    int32_t len = 0;
    const UChar* thestr = derb_getString(&(parent->fResData), r, &len);
    UChar *string = quotedString(thestr);
    if(trunc && len > truncsize) {
        char msg[128];
        printIndent(out, converter, indent);
        sprintf(msg, "// WARNING: this resource, size %li is truncated to %li\n",
            (long)len, (long)truncsize/2);
        printCString(out, converter, msg, -1);
        len = truncsize;
    }
    if(U_SUCCESS(*status)) {
        static const UChar openStr[] = { 0x003A, 0x0061, 0x006C, 0x0069, 0x0061, 0x0073, 0x0020, 0x007B, 0x0020, 0x0022 }; /* ":alias { \"" */
        static const UChar closeStr[] = { 0x0022, 0x0020, 0x007D, 0x0020 }; /* "\" } " */
        printIndent(out, converter, indent);
        if(key != NULL) {
            printCString(out, converter, key, -1);
        }
        printString(out, converter, openStr, (int32_t)(sizeof(openStr) / sizeof(*openStr)));
        printString(out, converter, string, len);
        printString(out, converter, closeStr, (int32_t)(sizeof(closeStr) / sizeof(*closeStr)));
        if(verbose) {
            printCString(out, converter, " // ALIAS", -1);
        }
        printString(out, converter, cr, (int32_t)(sizeof(cr) / sizeof(*cr)));
    } else {
        reportError(pname, status, "getting binary value");
    }
    uprv_free(string);
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:32,代码来源:derb.c


示例7: builtin_include

OBJ
builtin_include(int numArgs){

	if( numArgs != 1){
		js_error("(include): expects 1 argument", js_nil);
	}
	OBJ arg1 = POP();
	char *fileName;
	FILE *theFile;

	if( !ISSTRING(arg1) ){
		js_error("(include): string arg expected:", arg1);
	}
	fileName = STRINGVAL(arg1);
	theFile = fopen(fileName, "r");
	if( theFile == NULL){
		js_error("(include): cannot open file:", arg1); 	
	}

	OBJ inputStream = newFileStream(theFile);

#ifdef DEBUG
	if( PRINT_INCLUDE->state){
		printIndent(indentLevelForInclude);
	       	fprintf(stdout, "<include file:" YEL " %s" RESET" >\n", fileName);
		indentLevelForInclude++;
	}
	if( CONTINUATION_PASSING->state){
		enterTrampoline1(inputStream);
	} 
	else{
		OBJ expr = js_read(inputStream);
		OBJ result;

		while( expr != js_eof){	
			result = js_eval(globalEnvironment, expr);
			if(PRINT_INCLUDE->state){
				printIndent(indentLevelForInclude);
				js_print(stdout, result,1);
				printf("\n");
			}
			expr = js_read(inputStream);
		}
	}
	if( PRINT_INCLUDE->state){
		indentLevelForInclude--;
		printIndent(indentLevelForInclude);
	       	fprintf(stdout, "<EOF:" YEL " %s" RESET" >\n", fileName);
	}
#else
	enterTrampoline1(inputStream);
#endif
	fclose( inputStream->u.fileStream.file );
	free( inputStream);
	
	return js_void;
}
开发者ID:JohannesTheo,项目名称:JScheme,代码行数:57,代码来源:builtinFunctions.c


示例8: peekUint8

void Script_v6::o6_assign(FuncParams &params) {
	uint8 type = peekUint8();
	uint16 var_0, var_4;
	std::string varIndex = readVarIndex(&var_0, &var_4);

	if (var_0 != 0) {
		std::string varIndex2;
		uint16 var_6;

		uint32 savedPos = getPos();

		varIndex2 = readVarIndex(&var_6, 0);

		printIndent();
		print("memcpy(%s, %s, %d);\n", varIndex.c_str(), varIndex2.c_str(), var_6 * 4);

		seek(savedPos);
		skipExpr(99);

		return;
	}

	if (peekUint8() == 98) {
		skip(1);
		uint8 loopCount = readUint8();

		uint32 off = 0;
		for (uint16 i = 0; i < loopCount; i++) {
			uint8 c = readUint8();
			uint16 n = readUint16();

			printIndent();
			print("memset(%s + %d, %d, %d);\n", varIndex.c_str(), off, c, n);

			off += n;
		}
	} else if (peekUint8() == 99) {
		skip(1);
		uint8 loopCount = readUint8();

		for (uint16 i = 0; i < loopCount; i++) {
			std::string expr = readExpr();
			printIndent();
			print("%s[%d] = %s;\n", varIndex.c_str(), (type == 24) ? (i * 2) : i, expr.c_str());
		}
	} else {
		std::string expr = readExpr();

		printIndent();
		print("%s = %s;\n", varIndex.c_str(), expr.c_str());
	}
}
开发者ID:CobaltBlues,项目名称:scummvm-tools,代码行数:52,代码来源:degob_script_v6.cpp


示例9: printIndent

void space::print() {
  printIndent();
  lprintf("%4s: oops: 0x%-6lx -> 0x%-6lx; used: %ld bytes\n",
         name, objs_bottom, objs_top,
         (char*) objs_top - (char*) objs_bottom);
  printIndent();
  lprintf("     bytes: 0x%-6lx -> 0x%-6lx; used: %ld bytes\n",
         bytes_bottom, bytes_top,
         (char*) bytes_top - (char*) bytes_bottom);
  printIndent();
  lprintf("     total: used: %ld bytes; free: %ld bytes\n",
         used(), bytes_free());
}
开发者ID:ardeujho,项目名称:self,代码行数:13,代码来源:space.cpp


示例10: printFrames

static void printFrames(const WebCore::Frame& frame, const WebCore::Frame* targetFrame, int indent)
{
    if (&frame == targetFrame) {
        printf("--> ");
        printIndent(indent - 1);
    } else
        printIndent(indent);

    WebCore::FrameView* view = frame.view();
    printf("Frame %p %dx%d\n", &frame, view ? view->width() : 0, view ? view->height() : 0);
    printIndent(indent);
    printf("  ownerElement=%p\n", frame.ownerElement());
    printIndent(indent);
    printf("  frameView=%p (needs layout %d)\n", view, view ? view->needsLayout() : false);
    printIndent(indent);
    printf("  renderView=%p\n", view ? view->renderView() : nullptr);
    printIndent(indent);
    printf("  ownerRenderer=%p\n", frame.ownerRenderer());
    printIndent(indent);
    printf("  document=%p (needs style recalc %d)\n", frame.document(), frame.document() ? frame.document()->childNeedsStyleRecalc() : false);
    printIndent(indent);
    printf("  uri=%s\n", frame.document()->documentURI().utf8().data());

    for (WebCore::Frame* child = frame.tree().firstChild(); child; child = child->tree().nextSibling())
        printFrames(*child, targetFrame, indent + 1);
}
开发者ID:cheekiatng,项目名称:webkit,代码行数:26,代码来源:FrameTree.cpp


示例11: printAlternative

/** Print the parts of an @a Alternative
	@param alternative The @a Alternative to print

	Note: actions are printed only as {...}
*/
static void printAlternative(Alternative *alternative) {
	GrammarPart *grammarPart;
	int i;
	
	for (i = 0; i < listSize(alternative->parts); i++) {
		grammarPart = (GrammarPart *) listIndex(alternative->parts, i);
		printIndent();
		switch (grammarPart->subtype) {
			case PART_ACTION:
				fputs("{...}", printRuleOutput);
				break;
			case PART_TERMINAL:
			case PART_LITERAL:
				fputs(grammarPart->token->text, printRuleOutput);
				break;
			case PART_NONTERMINAL:
			case PART_UNDETERMINED:
				fputs(grammarPart->token->text, printRuleOutput);
				break;
			case PART_TERM:
				fputs("[\n", printRuleOutput);
				/* Only print the sets for repeating terms */
				if (!(grammarPart->uTerm.repeats.subtype == FIXED && grammarPart->uTerm.repeats.number == 1)) {
					printSet("First-set", grammarPart->uTerm.first);
					printSet("Contains-set", grammarPart->uTerm.contains);
					printSet("Follow-set", grammarPart->uTerm.follow);
				}
				indent++;
				if (grammarPart->uTerm.flags & TERM_WHILE) {
					printIndent();
					fprintf(printRuleOutput, "%%while %s\n", grammarPart->uTerm.expression->text);
				}
				if (grammarPart->uTerm.flags & TERM_PERSISTENT) {
					printIndent();
					fputs("%persistent\n", printRuleOutput);
				}
				printTerm(&grammarPart->uTerm);
				indent--;
				printIndent();
				fputc(']', printRuleOutput);
				printRepeats(grammarPart->uTerm.repeats);
				break;
			default:
				PANIC();
		}
		fputc('\n', printRuleOutput);
	}
}
开发者ID:guilhermealles,项目名称:cclabs,代码行数:53,代码来源:printInput.c


示例12: printIndent

void ExprFromBool::PrintDebug(int level) {
   printIndent(level);
   if(m_value)
      std::cout << "True";
   else
      std::cout << "False";
}
开发者ID:ismaelbelghiti,项目名称:MetaCode,代码行数:7,代码来源:Expression.cpp


示例13: printIndent

void realSlotRef::print() {
  holder->print();
  printIndent();
  lprintf("desc: 0x%lx (", desc);
  desc->name->string_print();
  lprintf(")\n");
}
开发者ID:ardeujho,项目名称:self,代码行数:7,代码来源:slotRef.cpp


示例14: printIndent

void ScopedLogger::indent()
{
    if (m_parent) {
        m_parent->indent();
        printIndent();
    }
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:7,代码来源:Assertions.cpp


示例15: printIndent

void PrintingContext::print (const char *name, dReal x)
{
    printIndent();
    fprintf (file,"%s = ",name);
    printReal (x);
    fprintf (file,",\n");
}
开发者ID:Yanzqing,项目名称:BHumanCodeRelease,代码行数:7,代码来源:export-dif.cpp


示例16: printIndent

void
ConfigItem::dump(
	StringBuffer &				buf,
	const char *				name,
	bool						wantExpandedUidNames,
	int							indentLevel) const
{
	int							i;
	int							len;
	char *						escStr;
	StringBuffer				nameBuf;
	UidIdentifierProcessor		uidIdProc;

	if (!wantExpandedUidNames) {
		name = uidIdProc.unexpand(name, nameBuf);
	}
	printIndent(buf, indentLevel);
	switch (m_type) {
	case Configuration::CFG_STRING:
		escStr = escapeString(m_stringVal);
		buf << name << " = \"" << escStr << "\";\n";
		delete [] escStr;
		break;
	case Configuration::CFG_LIST:
		buf << name << " = [";
		len = m_listVal->length();
		for (i = 0; i < len; i++) {
			escStr = escapeString((*m_listVal)[i]);
			buf << "\"" << escStr << "\"";
			delete [] escStr;
			if (i < len-1) {
				buf << ", ";
			}
		}
		buf << "];\n";
		break;
	case Configuration::CFG_SCOPE:
		buf << name << " {\n";
		m_scope->dump(buf, wantExpandedUidNames, indentLevel + 1);
		printIndent(buf, indentLevel);
		buf << "}\n";
		break;
	default:
		assert(0);	// Bug
		break;
	};
}
开发者ID:2mia,项目名称:config4cpp,代码行数:47,代码来源:ConfigItem.cpp


示例17: readUint8

void Script_v2::o2_popVars(FuncParams &params) {
	uint8 count = readUint8();

	for (uint16 i = 0; i < count; i++) {
		printIndent();
		print("pop(%s);\n", readVarIndex().c_str());
	}
}
开发者ID:CobaltBlues,项目名称:scummvm-tools,代码行数:8,代码来源:degob_script_v2.cpp


示例18: printIndent

void nmethod::printPcs() {
  ResourceMark m;       // in case methods get printed from gdb
  printIndent();
  lprintf("pc-bytecode offsets:\n");
  Indent ++;
  for (PcDesc* p = pcs(); p < pcsEnd(); p ++) p->print(this);
  Indent --;
}
开发者ID:AaronNGray,项目名称:self,代码行数:8,代码来源:nmethod.cpp


示例19: showVMT

void showVMT(VMT* src, int indent) {
    printIndent(indent);
    if ( src->isEmpty ) {
        printf("===== END =====\n");
        return;
    }
    printf("%d:\t%s_%s\n", src->offset, src->className, symToString(src->name));
    showVMT(src->next, indent);
}
开发者ID:halfdan,项目名称:ninjac,代码行数:9,代码来源:vmt.c


示例20: printIndent

void vframeLookupTarget::print() {
  printIndent();
  lprintf("vframeLookupTarget 0x%lx: ", this);
  receiver->print_real_oop();
  lprintf(" (map: 0x%lx)\n", map());
  Indent ++;
  vf->print_frame(0);
  Indent --;
}
开发者ID:ardeujho,项目名称:self,代码行数:9,代码来源:target.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ printInfo函数代码示例发布时间:2022-05-30
下一篇:
C++ printHex函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap