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

C++ Indent函数代码示例

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

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



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

示例1: PrintTree

static void PrintTree (DirEntry_s *direntry, int indent)
{
	if (!direntry) return;
	if (Option.print) {
		Indent(indent);
		printf("%s %s\n", direntry->type == T_DIR ? "D" : "F",
			direntry->name);
	}
	PrintTree(direntry->child, indent + 1);
	PrintTree(direntry->sibling, indent);
}
开发者ID:taysom,项目名称:tau,代码行数:11,代码来源:dir.c


示例2: Indent

void PicturePrinter::SetFontSpacing(int32 spacing) { 
	Indent(); Print("SetFontSpacing"); 
	switch(spacing) {
		case B_CHAR_SPACING: Print("B_CHAR_SPACING"); break;
		case B_STRING_SPACING: Print("B_STRING_SPACING"); break;
		case B_BITMAP_SPACING: Print("B_BITMAP_SPACING"); break;
		case B_FIXED_SPACING: Print("B_FIXED_SPACING"); break;
		default: Print("Unknown: ", (float)spacing);
	}
	Cr();
}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:11,代码来源:PicturePrinter.cpp


示例3: DumpStatementStart

static TRI_aql_node_t* DumpStatementStart (TRI_aql_statement_walker_t* const walker,
                                           TRI_aql_node_t* const node) {
  if (node == NULL) {
    return node;
  }

  assert(walker);
  Indent((TRI_aql_dump_t*) walker->_data);

  return DumpNode(walker, node);
}
开发者ID:eranshir,项目名称:ArangoDB,代码行数:11,代码来源:ahuacatl-statement-dump.c


示例4: PrintPos

 // Update current position, printing it if it's significantly different
 // from the previous position.
 void PrintPos(IRInst* inst, unsigned int indent)
 {
     const IRPos& newPos = inst->GetPos();
     if (newPos.GetFile() != mLastPos.GetFile() ||
         newPos.GetLine() > mLastPos.GetLine() + 5 ||
         newPos.GetLine() < mLastPos.GetLine()) {
         Indent(indent) << "#line " << newPos.GetLine() << " "
                        << '"' << newPos.GetFile() << '"' << "\n";
     }
     mLastPos = newPos;
 }
开发者ID:MarkLeone,项目名称:PostHaste,代码行数:13,代码来源:IRStmt.cpp


示例5: Indent

void MP4Integer64Property::Dump(FILE* pFile, u_int8_t indent,
	bool dumpImplicits, u_int32_t index)
{
	if (m_implicit && !dumpImplicits) {
		return;
	}
	Indent(pFile, indent);
	fprintf(pFile, 
		"%s = "U64" (0x%016"X64F")\n", 
		m_name, m_values[index], m_values[index]);
}
开发者ID:BOTCrusher,项目名称:sagetv,代码行数:11,代码来源:mp4property.cpp


示例6: Indent

void XmlWriter::WriteVector(const std::vector<T>& val) {
	Indent();
	typename std::vector<T>::const_iterator it;
	bool first = true;
	for (it = val.begin(); it != val.end(); it++) {
		if (!first)
			stream.put(' ');
		first = false;
		Write<T>(*it);
	}
}
开发者ID:EasyRPG,项目名称:liblcf,代码行数:11,代码来源:writer_xml.cpp


示例7: SaveStart

 void SaveStart(char const* name)
 {
     if (name == 0) return;
     if(m_depth > 0){
         this->This()->Save("\n");
         Indent();
     }
     ++m_depth;
     this->This()->Save("[");
     this->This()->Save(name);
     this->This()->Save("]:");
 }
开发者ID:sudarkoff,项目名称:serialization,代码行数:12,代码来源:BasicTextOutArchive.hpp


示例8: Indent

		void AstIfStatement::PrintInternal(ostream& o, int indentation)
		{
			o << Indent(indentation) << "if (";
			condition->Print(o, indentation, shared_from_this());
			o << endl;
			trueBranch->Print(o, indentation + 1, shared_from_this());
			if (falseBranch)
			{
				o << endl;
				falseBranch->Print(o, indentation + 1, shared_from_this());
			}
		}
开发者ID:umissthestars,项目名称:tinymoe,代码行数:12,代码来源:TinymoeAst.cpp


示例9: assert

//---------------------------------------------------------
DocumentXML& DocumentXML::toParent() {
  assert(NodeStack.size() > 1 && "too much backtracking");

  if (HasCurrentNodeSubNodes) {
    Indent();
    Out << "</" << NodeStack.top() << ">\n";
  } else
    Out << "/>\n";
  NodeStack.pop();
  HasCurrentNodeSubNodes = true;
  return *this;
}
开发者ID:HenderOrlando,项目名称:clamav-bytecode-compiler,代码行数:13,代码来源:DocumentXML.cpp


示例10: ChunkHModelNode

void ChunkHModelNode(BYTE *data, DWORD size)
{
    W3dHModelNodeStruct *node = (W3dHModelNodeStruct *) data;

    int num_nodes = size / sizeof(W3dHModelNodeStruct);

    for (int i=0; i<num_nodes; i++)
    {
        printf("HModelNode.Name: \"%s\"\n", node->RenderObjName);
        fprintf(outf,"%sHModelNode.Name: \"%s\"\n", Indent(), node->RenderObjName);
    }
}
开发者ID:RavenB,项目名称:Earth-and-Beyond-server,代码行数:12,代码来源:ChunkTypes.cpp


示例11: DataLengthException

void	CameraRange::Process( uint32_t inStartOffset,
										uint32_t inEndOffset )
{
	if (inEndOffset != inStartOffset + 8)
	{
		throw DataLengthException( Name(), inStartOffset, inEndOffset, 8 );
	}
	
	Out() << Indent() << Name() << " ( " <<
		FetchFloat32( inStartOffset ) << " " <<
		FetchFloat32( inStartOffset+4 ) << " )\n";
}
开发者ID:refnum,项目名称:quesa,代码行数:12,代码来源:CameraRange.cpp


示例12: va_start

void CXMLExporterBase::Write(const char* lpszFormat, ...)
{
    va_list argList;
    va_start(argList, lpszFormat);

    Indent();

    // Write the data
    vfprintf(m_pFile, lpszFormat, argList);

    va_end(argList);
}
开发者ID:ragekit,项目名称:SketchupOutlines,代码行数:12,代码来源:XMLExporterBase.cpp


示例13: StartElement

	void StartElement(PCWSTR name)
	{
		if(!m_isTagClosed)
		{
			m_stream << ">\r\n";
		}
		Indent(m_stack.size());
		m_stream << '<' << name;
		m_stack.push_back(string(name));
		m_isTagClosed = false;
		m_hasChild = false;
	}
开发者ID:tablacus,项目名称:Avestan,代码行数:12,代码来源:xmlwriter.cpp


示例14: ChunkPivot

void ChunkPivot(BYTE *data, DWORD size)
{
    W3dPivotStruct *pivot = (W3dPivotStruct *) data;

    int num_pivots = size / sizeof(W3dPivotStruct);

    for (int i=0; i<num_pivots; i++)
    {
        printf("Pivot.Name: \"%s\"\n", pivot[i].Name);
        fprintf(outf,"%sPivot.Name: \"%s\"\n", Indent(), pivot[i].Name);
    }
}
开发者ID:RavenB,项目名称:Earth-and-Beyond-server,代码行数:12,代码来源:ChunkTypes.cpp


示例15: FunctionLogger

		FunctionLogger(const char *name, const char *fmt=NULL, ...) : mName(name) {
			Indent();
			printf("-> %s ", name);
			if (fmt) {
				va_list args;
				va_start(args, fmt);
				vprintf(fmt, args);
				va_end(args);
			}
			printf("\n");
			++sIndent;
		}
开发者ID:gesius,项目名称:AudioComplete,代码行数:12,代码来源:CAAudioFile.cpp


示例16: Indent

void
SystemOutputUsageFormatter::FormatArgument( const std::string& primaryName, bool hasVariableParameterCount, int maxArgumentCount, const std::vector<std::string>& aliases, const std::vector<std::string>& dependencyNames, const std::string& description )
{
    myUsage << std::endl << Indent() << primaryName;

    if( aliases.size() > 0 ) {
        bool firstAlias = true;
        myUsage << " (";
        for( auto& alias : aliases ) {
            if( !firstAlias ) {
                myUsage << ", ";
            }
            firstAlias = false;
            myUsage << alias;
        }
        myUsage << ")";
    }

    if( maxArgumentCount == Constructor::NO_PARAMETER_LIMIT ) {
        myUsage << " <arg1> ... <argN>";
    }
    else if( hasVariableParameterCount ) {
        for( int i = 0; i < maxArgumentCount; ++i ) {
            myUsage << (i == 0 ? "" : " ");
            myUsage << " <arg" << (i + 1) << ">";
        }
    }

    myUsage << std::endl << Indent() << Indent() << description;

    if( dependencyNames.size() > 0 ) {
        myUsage << std::endl << Indent() << Indent() << "Dependencies:";
        for( size_t i = 0; i < dependencyNames.size(); ++i ) {
            myUsage << (i == 0 ? "" : ", " );
            myUsage << dependencyNames[i];
        }

        myUsage << std::endl;
    }
}
开发者ID:PerMalmberg,项目名称:CmdParser4Cpp,代码行数:40,代码来源:SystemOutputUsageFormatter.cpp


示例17: while

ZString ValueList::GetString(int indent)
{
    // [ args ]

    ZString str = "[\n";

    m_iter.First();

    while (!m_iter.End()) {
        str += Indent(indent + 1) + m_iter.Value()->GetChildString(indent + 1);

        m_iter.Next();

        if (m_iter.End()) {
            str += "\n";
        } else {
            str += ",\n";
        }
    }

    return str + Indent(indent) + "]";
}
开发者ID:BackTrak,项目名称:Allegiance-R4-Engine,代码行数:22,代码来源:value.cpp


示例18: WriteSeq

 void WriteSeq(IRSeq* seq, unsigned int indent, bool noBraces)
 {
     const IRStringConst* funcName = seq->GetFuncName();
     if (funcName && !noBraces) {
         Indent(indent) << "{";
         if (funcName)
             mOut << " // " << funcName->Get();
         mOut << "\n";
         indent += 4;
     }
     const IRStmts& stmts = seq->GetStmts();
     IRStmts::const_iterator it;
     for (it = stmts.begin(); it != stmts.end(); ++it)
         Write(*it, indent);
     if (funcName && !noBraces) {
         indent -= 4;
         Indent(indent) << "}";
         if (funcName)
             mOut << " // " << funcName->Get();
         mOut << "\n";
     }
 }
开发者ID:MarkLeone,项目名称:PostHaste,代码行数:22,代码来源:IRStmt.cpp


示例19: Indent

HRESULT PrintingContentHandler::endElement( 
    /* [in] */ const wchar_t *pwchNamespaceUri,
    /* [in] */ int cchNamespaceUri,
    /* [in] */ const wchar_t *pwchLocalName,
    /* [in] */ int cchLocalName,
    /* [in] */ const wchar_t *pwchQName,
    /* [in] */ int cchQName)
{
    mIndent -= 4;
    Indent();
    printf( "end element \"%.*ls\"\n", cchLocalName, pwchLocalName );
    return S_OK;
}
开发者ID:Stretto,项目名称:mago,代码行数:13,代码来源:PrintingContentHandler.cpp


示例20: Indent

      /// <summary>Called for each occurrence of parameterless macros</summary>
      /// <param name="match">The match.</param>
      /// <param name="depth">Debugging output depth</param>
      /// <returns>Replacement text</returns>
      wstring  DescriptionParser::onMatchKeyword(const wsmatch& match, int depth) const 
      {
         const DescriptionMacro* m;
         wstring name = (match[1].matched ? match[1].str() : match[2].str()); // Retrieve keyword/macro
         
         // Lookup macro + recursively parse
         if (DescriptionLib.Macros.TryFind(name, m))
         {
#ifdef PRINT_CONSOLE
            Console << Cons::Cyan << Indent(depth) << "Matched Keyword: " << Cons::Yellow << match[0].str()
                    << Cons::White << " with " << Cons::Yellow << m->Text << ENDL;
#endif

            return m->Recursive ? Parse(m->Text, depth+1) : m->Text;
         }

#ifdef PRINT_CONSOLE
         Console << Cons::Red << Indent(depth) << "Ignored Keyword: " << Cons::White << match[0].str() << ENDL;
#endif

         // Failed: Return match
         return match[0].str();
      }
开发者ID:CyberSys,项目名称:X-Studio-2,代码行数:27,代码来源:DescriptionParser.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ Index函数代码示例发布时间:2022-05-30
下一篇:
C++ InRange函数代码示例发布时间: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