这篇教程C++ write_indent函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中write_indent函数的典型用法代码示例。如果您正苦于以下问题:C++ write_indent函数的具体用法?C++ write_indent怎么用?C++ write_indent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了write_indent函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: op_dcl/* * A method is an `operation', therefore a method decl is an `op dcl'. * I blame Elliot. */static gbooleanop_dcl(TreeState *state){ GSList *doc_comments = IDL_IDENT(IDL_OP_DCL(state->tree).ident).comments; /* * Verify that e.g. non-scriptable methods in [scriptable] interfaces * are declared so. Do this in a separate verification pass? */ if (!verify_method_declaration(state->tree)) return FALSE; if (doc_comments != NULL) { write_indent(state->file); printlist(state->file, doc_comments); } xpidl_write_comment(state, 2); write_indent(state->file); if (!write_method_signature(state->tree, state->file, AS_DECL, NULL)) return FALSE; fputs(" = 0;/n/n", state->file); return TRUE;}
开发者ID:mdaniel,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:29,
示例2: do_const_dclstatic gbooleando_const_dcl(TreeState *state){ struct _IDL_CONST_DCL *dcl = &IDL_CONST_DCL(state->tree); const char *name = IDL_IDENT(dcl->ident).str; gboolean is_signed; GSList *doc_comments = IDL_IDENT(dcl->ident).comments; IDL_tree real_type; const char *const_format; if (!verify_const_declaration(state->tree)) return FALSE; if (doc_comments != NULL) { write_indent(state->file); printlist(state->file, doc_comments); } /* Could be a typedef; try to map it to the real type. */ real_type = find_underlying_type(dcl->const_type); real_type = real_type ? real_type : dcl->const_type; is_signed = IDL_TYPE_INTEGER(real_type).f_signed; const_format = is_signed ? "%" IDL_LL "d" : "%" IDL_LL "uU"; write_indent(state->file); fprintf(state->file, "enum { %s = ", name); fprintf(state->file, const_format, IDL_INTEGER(dcl->const_exp).value); fprintf(state->file, " };/n/n"); return TRUE;}
开发者ID:mdaniel,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:31,
示例3: write_indentvoid Fl_Type::write_properties() { int level = 0; for (Fl_Type* p = parent; p; p = p->parent) level++; // repeat this for each attribute: if (!label().empty()) { write_indent(level+1); write_word("label"); write_word(label()); } if (!user_data().empty()) { write_indent(level+1); write_word("user_data"); write_word(user_data()); if (!user_data_type().empty()) { write_word("user_data_type"); write_word(user_data_type()); } } if (!callback().empty()) { write_indent(level+1); write_word("callback"); write_word(callback()); } if (is_parent() && open_) write_word("open"); if (selected) write_word("selected"); if (!tooltip().empty()) { write_indent(level+1); write_word("tooltip"); write_word(tooltip()); }}
开发者ID:edeproject,项目名称:efltk,代码行数:32,
示例4: add_directorystatic svn_error_t *add_directory(const char *path, void *parent_baton, const char *copyfrom_path, svn_revnum_t copyfrom_revision, apr_pool_t *pool, void **child_baton){ struct dir_baton *pb = parent_baton; struct edit_baton *eb = pb->edit_baton; struct dir_baton *b = apr_palloc(pool, sizeof(*b)); SVN_ERR(write_indent(eb, pool)); SVN_ERR(svn_stream_printf(eb->out, pool, "add_directory : '%s' [from '%s':%ld]/n", path, copyfrom_path, copyfrom_revision)); eb->indent_level++; SVN_ERR(eb->wrapped_editor->add_directory(path, pb->wrapped_dir_baton, copyfrom_path, copyfrom_revision, pool, &b->wrapped_dir_baton)); b->edit_baton = eb; *child_baton = b; return SVN_NO_ERROR;}
开发者ID:Alkzndr,项目名称:freebsd,代码行数:30,
示例5: open_filestatic svn_error_t *open_file(const char *path, void *parent_baton, svn_revnum_t base_revision, apr_pool_t *pool, void **file_baton){ struct dir_baton *pb = parent_baton; struct edit_baton *eb = pb->edit_baton; struct file_baton *fb = apr_palloc(pool, sizeof(*fb)); SVN_ERR(write_indent(eb, pool)); SVN_ERR(svn_stream_printf(eb->out, pool, "open_file : '%s':%ld/n", path, base_revision)); eb->indent_level++; SVN_ERR(eb->wrapped_editor->open_file(path, pb->wrapped_dir_baton, base_revision, pool, &fb->wrapped_file_baton)); fb->edit_baton = eb; *file_baton = fb; return SVN_NO_ERROR;}
开发者ID:Alkzndr,项目名称:freebsd,代码行数:28,
示例6: open_rootstatic svn_error_t *open_root(void *edit_baton, svn_revnum_t base_revision, apr_pool_t *pool, void **root_baton){ struct edit_baton *eb = edit_baton; struct dir_baton *dir_baton = apr_palloc(pool, sizeof(*dir_baton)); SVN_ERR(write_indent(eb, pool)); SVN_ERR(svn_stream_printf(eb->out, pool, "open_root : %ld/n", base_revision)); eb->indent_level++; SVN_ERR(eb->wrapped_editor->open_root(eb->wrapped_edit_baton, base_revision, pool, &dir_baton->wrapped_dir_baton)); dir_baton->edit_baton = edit_baton; *root_baton = dir_baton; return SVN_NO_ERROR;}
开发者ID:Alkzndr,项目名称:freebsd,代码行数:25,
示例7: write_indentvoid Logger::_start(Event const &event) { Util::ptr_shared<char> name=event.name(); if (empty_tag) { log_stream << ">/n"; } write_indent(log_stream, tag_stack().size()); log_stream << "<" << name.pointer(); unsigned property_count=event.propertyCount(); for ( unsigned i = 0 ; i < property_count ; i++ ) { Event::PropertyPair property=event.property(i); log_stream << " " << property.name.pointer() << "=/""; write_escaped_value(log_stream, property.value); log_stream << "/""; } log_stream.flush(); tag_stack().push_back(name); empty_tag = true; event.generateChildEvents();}
开发者ID:AakashDabas,项目名称:inkscape,代码行数:26,
示例8: write_section/** Write a section to the output. */static void write_section(t3_config_t *config, FILE *file, int indent) { while (config != NULL) { if (config->type == T3_CONFIG_PLIST) { write_plist(config, file, indent); config = config->next; continue; } write_indent(file, indent); fputs(config->name, file); switch (config->type) { case T3_CONFIG_BOOL: case T3_CONFIG_INT: case T3_CONFIG_NUMBER: case T3_CONFIG_STRING: case T3_CONFIG_LIST: fputs(" = ", file); write_value(config, file, indent); fputc('/n', file); break; case T3_CONFIG_SECTION: fputc(' ', file); write_value(config, file, indent); fputc('/n', file); break; default: /* This can only happen if the client screws up the list, which the interface does not allow by itself. */ break; } config = config->next; }}
开发者ID:gphalkes,项目名称:t3config,代码行数:34,
示例9: write_value/** Write a single value out to file. */static void write_value(t3_config_t *config, FILE *file, int indent) { switch (config->type) { case T3_CONFIG_BOOL: fputs(config->value.boolean ? "true" : "false", file); break; case T3_CONFIG_INT: write_int(file, config->value.integer); break; case T3_CONFIG_NUMBER: write_number(file, config->value.number); break; case T3_CONFIG_STRING: write_string(file, config->value.string); break; case T3_CONFIG_LIST: case T3_CONFIG_PLIST: fputs("( ", file); write_list(config->value.list, file, indent + 1); fputs(" )", file); break; case T3_CONFIG_SECTION: fputs("{/n", file); write_section(config->value.list, file, indent + 1); write_indent(file, indent); fputc('}', file); break; default: /* This can only happen if the client screws up the list. */ break; }}
开发者ID:gphalkes,项目名称:t3config,代码行数:32,
示例10: write_indentvoid Writer::operator() (const string_ref &s) { if (need_indent) { need_indent = 0; write_indent(); } append (s.begin(), s.length());}
开发者ID:AbramovVitaliy,项目名称:kphp-kdb,代码行数:7,
示例11: attr_dclstatic gbooleanattr_dcl(TreeState *state){ GSList *doc_comments; if (!verify_attribute_declaration(state->tree)) return FALSE; doc_comments = IDL_IDENT(IDL_LIST(IDL_ATTR_DCL (state->tree).simple_declarations).data).comments; if (doc_comments != NULL && comment_level >= 2) { write_indent(state->file); printlist(state->file, doc_comments); } /* * XXX lists of attributes with the same type, e.g. * attribute string foo, bar sil; * are legal IDL... but we don't do anything with 'em. */ if (IDL_LIST(IDL_ATTR_DCL(state->tree).simple_declarations).next != NULL) { XPIDL_WARNING((state->tree, IDL_WARNING1, "multiple attributes in a single declaration aren't " "currently supported by xpidl")); } xpidl_write_comment(state, 2); write_indent(state->file); write_indent(state->file); if (!write_attr_accessor(state->tree, state->file, TRUE, NULL)) return FALSE; fputs(": Longword; stdcall;/n", state->file); if (!IDL_ATTR_DCL(state->tree).f_readonly) { write_indent(state->file); write_indent(state->file); if (!write_attr_accessor(state->tree, state->file, FALSE, NULL)) return FALSE; fputs(": Longword; stdcall;/n", state->file); } /*fputc('/n', state->file);*/ return TRUE;}
开发者ID:byong2009,项目名称:bagel,代码行数:47,
示例12: write_indentvoid JsonOut::write_separator(){ stream->put(','); if (pretty_print) { stream->put('/n'); write_indent(); } need_separator = false;}
开发者ID:Doffeh,项目名称:Cataclysm-DDA,代码行数:9,
示例13: 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,
示例14: 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,
示例15: do_begin_array void do_begin_array() override { begin_structure(); if (indenting_ && !stack_.empty() && stack_.back().is_object()) { write_indent(); } stack_.push_back(stack_item(false)); bos_.put('['); indent(); }
开发者ID:BerndDoser,项目名称:Bonsai,代码行数:12,
示例16: 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,
示例17: begin_object virtual void begin_object() { begin_structure(); if (indenting_ && !stack_.empty() && stack_.back().is_object()) { write_indent(); } stack_.push_back(stack_item(true)); os_.put('{'); indent(); }
开发者ID:gusev-vitaliy,项目名称:jsoncons,代码行数:12,
示例18: 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,
示例19: do_begin_object void do_begin_object() override { begin_structure(); if (indenting_ && !stack_.empty() && stack_.back().is_object()) { write_indent(); } stack_.push_back(stack_item(true)); os_->put('{'); indent(); }
开发者ID:SaenkoDmitry,项目名称:Bogdan,代码行数:12,
示例20: write_separatorvoid JsonOut::start_array(){ if (need_separator) { write_separator(); } stream->put('['); if (pretty_print) { indent_level += 1; stream->put('/n'); write_indent(); } need_separator = false;}
开发者ID:Doffeh,项目名称:Cataclysm-DDA,代码行数:13,
示例21: close_editstatic svn_error_t *close_edit(void *edit_baton, apr_pool_t *pool){ struct edit_baton *eb = edit_baton; SVN_ERR(write_indent(eb, pool)); SVN_ERR(svn_stream_printf(eb->out, pool, "close_edit/n")); SVN_ERR(eb->wrapped_editor->close_edit(eb->wrapped_edit_baton, pool)); return SVN_NO_ERROR;}
开发者ID:Alkzndr,项目名称:freebsd,代码行数:13,
示例22: xml_writer_element_startint xml_writer_element_start(XMLWriter* writer, const char* name){ if (writer->previousWrite == ELEMENT_START || writer->previousWrite == ATTRIBUTE) { CHK_ORET(fprintf(writer->file, ">") > 0); } write_indent(writer); CHK_ORET(fprintf(writer->file, "<%s", name) > 0); writer->indent++; writer->previousWrite = ELEMENT_START; return 1;}
开发者ID:DraFFty,项目名称:libMXF,代码行数:14,
示例23: begin_element void begin_element() { if (!stack_.empty()) { if (stack_.back().count_ > 0) { os_->put(','); } if (indenting_) { write_indent(); } } }
开发者ID:SaenkoDmitry,项目名称:Bogdan,代码行数:14,
示例24: set_target_revisionstatic svn_error_t *set_target_revision(void *edit_baton, svn_revnum_t target_revision, apr_pool_t *pool){ struct edit_baton *eb = edit_baton; SVN_ERR(write_indent(eb, pool)); SVN_ERR(svn_stream_printf(eb->out, pool, "set_target_revision : %ld/n", target_revision)); return eb->wrapped_editor->set_target_revision(eb->wrapped_edit_baton, target_revision, pool);}
开发者ID:Alkzndr,项目名称:freebsd,代码行数:15,
示例25: close_directorystatic svn_error_t *close_directory(void *dir_baton, apr_pool_t *pool){ struct dir_baton *db = dir_baton; struct edit_baton *eb = db->edit_baton; eb->indent_level--; SVN_ERR(write_indent(eb, pool)); SVN_ERR(svn_stream_printf(eb->out, pool, "close_directory/n")); SVN_ERR(eb->wrapped_editor->close_directory(db->wrapped_dir_baton, pool)); return SVN_NO_ERROR;}
开发者ID:Alkzndr,项目名称:freebsd,代码行数:16,
示例26: absent_filestatic svn_error_t *absent_file(const char *path, void *file_baton, apr_pool_t *pool){ struct file_baton *fb = file_baton; struct edit_baton *eb = fb->edit_baton; SVN_ERR(write_indent(eb, pool)); SVN_ERR(svn_stream_printf(eb->out, pool, "absent_file : %s/n", path)); SVN_ERR(eb->wrapped_editor->absent_file(path, fb->wrapped_file_baton, pool)); return SVN_NO_ERROR;}
开发者ID:Alkzndr,项目名称:freebsd,代码行数:16,
注:本文中的write_indent函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ write_index函数代码示例 C++ write_in_full函数代码示例 |