这篇教程C++ unindent函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中unindent函数的典型用法代码示例。如果您正苦于以下问题:C++ unindent函数的具体用法?C++ unindent怎么用?C++ unindent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了unindent函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: switchvoid StyledStreamWriter::writeValue( const Value &value ){ switch ( value.type() ) { case nullValue: pushValue( "null" ); break; case intValue: pushValue( valueToString( value.asLargestInt() ) ); break; case uintValue: pushValue( valueToString( value.asLargestUInt() ) ); break; case realValue: pushValue( valueToString( value.asDouble() ) ); break; case stringValue: pushValue( valueToQuotedString( value.asCString() ) ); break; case booleanValue: pushValue( valueToString( value.asBool() ) ); break; case arrayValue: writeArrayValue( value); break; case objectValue: { Value::Members members( value.getMemberNames() ); if ( members.empty() ) pushValue( "{}" ); else { writeWithIndent( "{" ); indent(); Value::Members::iterator it = members.begin(); for (;;) { const std::string &name = *it; const Value &childValue = value[name]; writeCommentBeforeValue( childValue ); writeWithIndent( valueToQuotedString( name.c_str() ) ); *document_ << " : "; writeValue( childValue ); if ( ++it == members.end() ) { writeCommentAfterValueOnSameLine( childValue ); break; } *document_ << ","; writeCommentAfterValueOnSameLine( childValue ); } unindent(); writeWithIndent( "}" ); } } break; }}
开发者ID:vateran,项目名称:todengine,代码行数:59,
示例2: visit virtual void visit(ExprStmt &n) { out << indent_str() << "<ExprStmt>/n"; indent(); n.expr->accept(*this); unindent(); out << indent_str() << "</ExprStmt>/n"; }
开发者ID:kleopatra999,项目名称:pop,代码行数:8,
示例3: pushValuevoidStyledStreamWriter::writeArrayValue ( const Value& value ){ unsigned size = value.size (); if ( size == 0 ) pushValue ( "[]" ); else { bool isArrayMultiLine = isMultineArray ( value ); if ( isArrayMultiLine ) { writeWithIndent ( "[" ); indent (); bool hasChildValue = !childValues_.empty (); unsigned index = 0; while ( true ) { const Value& childValue = value[index]; if ( hasChildValue ) writeWithIndent ( childValues_[index] ); else { writeIndent (); writeValue ( childValue ); } if ( ++index == size ) break; *document_ << ","; } unindent (); writeWithIndent ( "]" ); } else // output on a single line { assert ( childValues_.size () == size ); *document_ << "[ "; for ( unsigned index = 0; index < size; ++index ) { if ( index > 0 ) *document_ << ", "; *document_ << childValues_[index]; } *document_ << " ]"; } }}
开发者ID:CFQuantum,项目名称:CFQuantumd,代码行数:56,
示例4: code_string_elemstatic void code_string_elem( Telem* elem ){ fprintf( outfile, "( /"%s/",/n", elem->params[0]->data.name ); indent(); codeelemparam( elem->params[1] ); fprintf( outfile, "/n" ); unindent(); codeindent(); fprintf( outfile, ")" );}
开发者ID:sanikoyes,项目名称:iup,代码行数:10,
示例5: code_elemstatic void code_elem( Telem* elem ){ fprintf( outfile, "(/n" ); indent(); codeelemparam( elem->params[0] ); fprintf( outfile, "/n" ); unindent(); codeindent(); fprintf( outfile, ")" );}
开发者ID:sanikoyes,项目名称:iup,代码行数:10,
示例6: do_end_object void do_end_object() override { unindent(); if (indenting_ && !stack_.empty()) { write_indent(); } stack_.pop_back(); os_->put('}'); end_value(); }
开发者ID:SaenkoDmitry,项目名称:Bogdan,代码行数:12,
示例7: do_end_array void do_end_array() override { unindent(); if (indenting_ && !stack_.empty() && stack_.back().content_indented_) { write_indent(); } stack_.pop_back(); os_->put(']'); end_value(); }
开发者ID:SaenkoDmitry,项目名称:Bogdan,代码行数:12,
示例8: end_object virtual void end_object() { unindent(); if (indenting_ && !stack_.empty()) { write_indent(); } stack_.pop_back(); os_.put('}'); end_value(); }
开发者ID:gusev-vitaliy,项目名称:jsoncons,代码行数:12,
示例9: end_array virtual void end_array() { unindent(); if (indenting_ && !stack_.empty() && stack_.back().content_indented_) { write_indent(); } stack_.pop_back(); os_.put(']'); end_value(); }
开发者ID:gusev-vitaliy,项目名称:jsoncons,代码行数:12,
示例10: indentstack_tracer::stack_tracer (const char * sig, const char * file, int line, const char * msg) : sig_ (sig) , file_ (file) , line_ (line) , msg_ (msg){ std::string out; indent_++; if ( enabled ) { out += indent (); out += " -> "; out += unindent (); if ( 0 == sizeof (msg_) ) { out += msg_; out += "/n"; out += indent (); out += " > /n"; out += unindent (); } out += sig_; out += " : "; out += file_; out += " +"; out += saga::util::itoa (line_); saga::util::log (saga::util::logging::Debug, "stack trace level" + saga::util::itoa (indent_), out); /// get_stack_ ().push_back (sig_ + " - " + msg_); }}
开发者ID:andre-merzky,项目名称:plover,代码行数:39,
示例11: pushValuevoid StyledWriter::writeArrayValue( const Value &value ){ unsigned size = value.size(); if ( size == 0 ) pushValue( "[]" ); else { bool isArrayMultiLine = isMultineArray( value ); if ( isArrayMultiLine ) { writeWithIndent( "[" ); indent(); bool hasChildValue = !childValues_.empty(); unsigned index =0; for (;;) { const Value &childValue = value[index]; writeCommentBeforeValue( childValue ); if ( hasChildValue ) writeWithIndent( childValues_[index] ); else { writeIndent(); writeValue( childValue ); } if ( ++index == size ) { writeCommentAfterValueOnSameLine( childValue ); break; } document_ += ","; writeCommentAfterValueOnSameLine( childValue ); } unindent(); writeWithIndent( "]" ); } else // output on a single line { assert( childValues_.size() == size ); document_ += "[ "; for ( unsigned index =0; index < size; ++index ) { if ( index > 0 ) document_ += ", "; document_ += childValues_[index]; } document_ += " ]"; } }}
开发者ID:vateran,项目名称:todengine,代码行数:51,
示例12: code_elemliststatic void code_elemlist( Telem* elem ){ int i=0; fprintf( outfile, "(/n" ); indent(); for (i=0; i<elem->nparams; i++) { codeelemparam( elem->params[i] ); fprintf( outfile, ",/n" ); } unindent(); codeindent(); fprintf( outfile, "NULL)" );}
开发者ID:sanikoyes,项目名称:iup,代码行数:14,
示例13: bufferFromBlock void bufferFromBlock(KviCString & szBuffer) { szBuffer.trim(); if((*(szBuffer.ptr()) == '{') && szBuffer.lastCharIs('}')) { // leading and trailing { must be stripped szBuffer.cutLeft(1); szBuffer.cutRight(1); } unindent(szBuffer); szBuffer.trim(); }
开发者ID:namikaze90,项目名称:KVIrc-old,代码行数:15,
注:本文中的unindent函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ uninit函数代码示例 C++ unimplemented_函数代码示例 |