本文整理汇总了C++中do_indent函数的典型用法代码示例。如果您正苦于以下问题:C++ do_indent函数的具体用法?C++ do_indent怎么用?C++ do_indent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了do_indent函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: do_indent
void IRPrinter::visit(const Pipeline *op) {
do_indent();
stream << "produce " << op->name << " {" << endl;
indent += 2;
print(op->produce);
indent -= 2;
if (op->update.defined()) {
do_indent();
stream << "} update {" << endl;
indent += 2;
print(op->update);
indent -= 2;
}
do_indent();
stream << "} consume {" << endl;
indent += 2;
print(op->consume);
indent -= 2;
do_indent();
stream << "}" << endl;
}
开发者ID:slippy0,项目名称:Halide,代码行数:26,代码来源:IRPrinter.cpp
示例2: debug_each_source_column
static void
debug_each_source_column()
{
do_indent ();
fprintf (ipf->output_fp, "<s_col %d cindex=%d text=\"%s\" ",
iterate_source_column->index,
iterate_source_column->cindex,
iterate_source_column->filler_flag ? (Uchar*)"<filler>" : iterate_source_column->text);
if (!iterate_source_column->index && *iterate_line->altsig)
fprintf (ipf->output_fp, "(aka `%s') ", iterate_line->altsig);
fprintf (ipf->output_fp, "cols=%d viswidth=%d zero=%s space=%s phant=%s",
iterate_source_column->columns_occupied,
iterate_source_column->visible_width,
t_or_f(iterate_composite_column->zero_flag),
t_or_f(iterate_composite_column->space_flag),
t_or_f(iterate_source_column->needs_phantom));
fprintf (ipf->output_fp, "\n");
do_indent ();
fprintf (ipf->output_fp, "\tcomposite = %p; composite_end = %p\n",
iterate_source_column->composite,
iterate_source_column->composite_end);
do_indent ();
fprintf (ipf->output_fp, " complex = %p ", iterate_source_column->complex);
if (iterate_source_column->complex_text)
{
fprintf (ipf->output_fp, "complex_has_variant=%s complex_text = `%s'>\n",
t_or_f(iterate_source_column->complex_has_variant),
print_escaped(iterate_source_column->complex_text));
}
else
fprintf (ipf->output_fp, ">\n");
}
开发者ID:EleanorRobson,项目名称:oracc,代码行数:32,代码来源:pf-debug.c
示例3: json_line_open_windows
static void json_line_open_windows(FILE *f, int indent, const char *key,
const List<SettingsFileOpenWindow> &open_windows)
{
do_indent(f, indent);
fprintf(f, "%s: ", key);
json_line_indent(f, &indent, "[");
for (int i = 0; i < open_windows.length(); i += 1) {
const SettingsFileOpenWindow *open_window = &open_windows.at(i);
do_indent(f, indent);
json_line_indent(f, &indent, "{");
json_line_comment(f, indent, "which perspective this window uses");
json_line_int(f, indent, "perspective", open_window->perspective_index);
fprintf(f, "\n");
json_line_comment(f, indent, "position of the window on the screen");
json_line_int(f, indent, "left", open_window->left);
json_line_int(f, indent, "top", open_window->top);
json_line_int(f, indent, "width", open_window->width);
json_line_int(f, indent, "height", open_window->height);
json_line_bool(f, indent, "maximized", open_window->maximized);
fprintf(f, "\n");
json_line_comment(f, indent, "whether to show dockable pane tabs when there is only one");
json_line_bool(f, indent, "always_show_tabs", open_window->always_show_tabs);
fprintf(f, "\n");
json_line_outdent(f, &indent, "},");
}
json_line_outdent(f, &indent, "],");
}
开发者ID:eriser,项目名称:genesis,代码行数:33,代码来源:settings_file.cpp
示例4: debug_each_composite_column
static void
debug_each_composite_column()
{
List *vlist;
do_indent ();
fprintf (ipf->output_fp,
"<comp_col %d text=\"%s\" delim=\"%s\" viswidth=%d maxwidth=%d zero=%s space=%s\n",
iterate_composite_column->index,
iterate_composite_column->text,
print_escaped(iterate_composite_column->delim),
iterate_composite_column->visible_width,
iterate_composite_column->maxwidth,
t_or_f(iterate_composite_column->zero_flag),
t_or_f(iterate_composite_column->space_flag));
do_indent ();
fprintf (ipf->output_fp,
"\tcomplex_index=%d complex_columns=%d complex_has_variant=%s s_l_d=%s phant=%s>\n",
iterate_composite_column->complex_index,
iterate_composite_column->complex_columns,
t_or_f(iterate_composite_column->complex->complex_has_variant),
t_or_f(iterate_composite_column->short_line_divider),
t_or_f(iterate_composite_column->needs_phantom));
do_indent ();
fprintf (ipf->output_fp, "\tcomplex = %p\n", iterate_composite_column);
vlist = vars_lookup2(iterate_line->name, iterate_composite_column->index);
if (list_len(vlist))
{
indent += 2;
vars_normalize_length(vlist);
list_exec (vlist, debug_print_variant);
indent -= 2;
}
}
开发者ID:EleanorRobson,项目名称:oracc,代码行数:34,代码来源:pf-debug.c
示例5: json_line_dock
static void json_line_dock(FILE *f, int indent, const char *key, const SettingsFileDock *dock) {
assert(dock);
do_indent(f, indent);
fprintf(f, "%s: ", key);
json_line_indent(f, &indent, "{");
json_line_str(f, indent, "dock_type", dock_type_to_str(dock->dock_type));
switch (dock->dock_type) {
case SettingsFileDockTypeTabs:
do_indent(f, indent);
fprintf(f, "tabs: [");
for (int i = 0; i < dock->tabs.length(); i += 1) {
json_inline_str(f, dock->tabs.at(i).encode());
if (i < dock->tabs.length() - 1)
fprintf(f, ", ");
}
fprintf(f, "],\n");
break;
case SettingsFileDockTypeHoriz:
case SettingsFileDockTypeVert:
json_line_float(f, indent, "split_ratio", dock->split_ratio);
json_line_dock(f, indent, "child_a", dock->child_a);
json_line_dock(f, indent, "child_b", dock->child_b);
break;
}
json_line_outdent(f, &indent, "},");
}
开发者ID:eriser,项目名称:genesis,代码行数:30,代码来源:settings_file.cpp
示例6: json_line_str_list
static void json_line_str_list(FILE *f, int indent, const char *key, const List<ByteBuffer> &value) {
do_indent(f, indent);
fprintf(f, "%s: ", key);
json_line_indent(f, &indent, "[");
for (int i = 0; i < value.length(); i += 1) {
do_indent(f, indent);
json_inline_str(f, value.at(i));
fprintf(f, ",\n");
}
json_line_outdent(f, &indent, "],\n");
}
开发者ID:eriser,项目名称:genesis,代码行数:11,代码来源:settings_file.cpp
示例7: debug_before_block
static void
debug_before_block()
{
do_indent ();
fprintf (ipf->output_fp, "<block %d>\n", iterate_block->index);
indent += 2;
}
开发者ID:EleanorRobson,项目名称:oracc,代码行数:7,代码来源:pf-debug.c
示例8: debug_after_reconstructed
static void
debug_after_reconstructed()
{
indent -= 2;
do_indent ();
fprintf (ipf->output_fp, "</reconstructed %d>\n", iterate_line->index);
}
开发者ID:EleanorRobson,项目名称:oracc,代码行数:7,代码来源:pf-debug.c
示例9: debug_after_source
static void
debug_after_source()
{
indent -= 2;
do_indent ();
fprintf (ipf->output_fp, "</source %d>\n", iterate_line->index);
}
开发者ID:EleanorRobson,项目名称:oracc,代码行数:7,代码来源:pf-debug.c
示例10: debug_after_block
static void
debug_after_block()
{
indent -= 2;
do_indent ();
fprintf (ipf->output_fp, "</block %d>\n", iterate_block->index);
}
开发者ID:EleanorRobson,项目名称:oracc,代码行数:7,代码来源:pf-debug.c
示例11: debug_after_outers
static void
debug_after_outers()
{
indent -= 2;
do_indent ();
fprintf (ipf->output_fp, "</outer %d>\n", iterate_outer->index);
}
开发者ID:EleanorRobson,项目名称:oracc,代码行数:7,代码来源:pf-debug.c
示例12: SDL_GetTicks
void scope_logger::do_log_exit()
{
const int ticks = SDL_GetTicks() - ticks_;
--indent;
do_indent();
if (timestamp) (*output_) << get_timestamp(time(nullptr));
(*output_) << "} END: " << str_ << " (took " << ticks << "ms)\n";
}
开发者ID:ScegfOd,项目名称:wesnoth,代码行数:8,代码来源:log.cpp
示例13: debug_each_reconstructed_column
static void
debug_each_reconstructed_column()
{
do_indent ();
fprintf (ipf->output_fp, "<recons_col %d text=\"%s\" delim=\"%s\" maxwidth=%d\n",
iterate_reconstructed_column->index,
iterate_reconstructed_column->text,
print_escaped(iterate_reconstructed_column->delim),
iterate_reconstructed_column->maxwidth);
do_indent ();
fprintf (ipf->output_fp, "\tcomplex_index=%d complex_columns=%d zero=%s space=%s phant=%s>\n",
iterate_reconstructed_column->complex_index,
iterate_reconstructed_column->complex_columns,
t_or_f(iterate_reconstructed_column->zero_flag),
t_or_f(iterate_reconstructed_column->space_flag),
t_or_f(iterate_reconstructed_column->needs_phantom));
}
开发者ID:EleanorRobson,项目名称:oracc,代码行数:17,代码来源:pf-debug.c
示例14: debug_each_outer
static void
debug_each_outer ()
{
indent -= 2;
do_indent ();
fprintf (ipf->output_fp, "<outer %d>\n", iterate_outer->index);
indent += 2;
}
开发者ID:EleanorRobson,项目名称:oracc,代码行数:8,代码来源:pf-debug.c
示例15: do_indent
void scope_logger::do_log_exit()
{
const long ticks = (boost::posix_time::microsec_clock::local_time() - ticks_).total_milliseconds();
--indent;
do_indent();
if (timestamp) (*output_) << get_timestamp(time(nullptr));
(*output_) << "} END: " << str_ << " (took " << ticks << "ms)\n";
}
开发者ID:Wedge009,项目名称:wesnoth,代码行数:8,代码来源:log.cpp
示例16: settings_file_commit
int settings_file_commit(SettingsFile *sf) {
OsTempFile tmp_file;
int err = os_create_temp_file(os_path_dirname(sf->path).raw(), &tmp_file);
if (err)
return err;
FILE *f = tmp_file.file;
int indent = 0;
json_line_comment(f, indent, "Genesis DAW configuration file");
json_line_comment(f, indent, "This config file format is a superset of JSON. See");
json_line_comment(f, indent, "https://github.com/andrewrk/liblaxjson for more details.");
json_line_comment(f, indent, "WARNING: This file is sporadically overwritten while Genesis is running.");
do_indent(f, indent);
json_line_indent(f, &indent, "{");
json_line_comment(f, indent, "your display name");
json_line_str(f, indent, "user_name", sf->user_name.encode());
fprintf(f, "\n");
json_line_comment(f, indent, "your user id");
json_line_uint256(f, indent, "user_id", sf->user_id);
fprintf(f, "\n");
json_line_comment(f, indent, "extra directories to search for samples.");
json_line_comment(f, indent, "note: ~/.genesis/samples/ is always searched.");
json_line_str_list(f, indent, "sample_dirs", sf->sample_dirs);
fprintf(f, "\n");
json_line_comment(f, indent, "open this project on startup");
json_line_uint256(f, indent, "open_project_id", sf->open_project_id);
fprintf(f, "\n");
json_line_comment(f, indent, "these perspectives are available for the user to choose from");
json_line_perspectives(f, indent, "perspectives", sf->perspectives);
fprintf(f, "\n");
json_line_comment(f, indent, "open these windows on startup");
json_line_open_windows(f, indent, "open_windows", sf->open_windows);
fprintf(f, "\n");
json_line_comment(f, indent, "how many seconds long should audio buffers be");
json_line_comment(f, indent, "a shorter value makes genesis respond to events faster");
json_line_comment(f, indent, "a larger value guards against buffer underruns");
json_line_double(f, indent, "latency", sf->latency);
fprintf(f, "\n");
json_line_outdent(f, &indent, "}");
if (fclose(f))
return GenesisErrorFileAccess;
err = os_rename_clobber(tmp_file.path.raw(), sf->path.raw());
if (err)
return err;
return 0;
}
开发者ID:eriser,项目名称:genesis,代码行数:58,代码来源:settings_file.cpp
示例17: do_indent
void xmlt::output(std::ostream &out, unsigned indent) const
{
// 'name' needs to be set, or we produce mal-formed
// XML.
if(name=="")
return;
do_indent(out, indent);
out << '<' << name;
for(const auto &attribute : attributes)
{
// it.first needs to be non-empty
if(attribute.first.empty())
continue;
out << ' ' << attribute.first
<< '=' << '"';
escape_attribute(attribute.second, out);
out << '"';
}
if(elements.empty() && data.empty())
{
out << "/>" << "\n";
return;
}
out << '>';
if(elements.empty())
escape(data, out);
else
{
out << "\n";
for(const auto &element : elements)
element.output(out, indent+2);
do_indent(out, indent);
}
out << '<' << '/' << name << '>' << "\n";
}
开发者ID:danpoe,项目名称:cbmc,代码行数:45,代码来源:xml.cpp
示例18: json_document_end
void
json_document_end (json_ctx_t *ctx)
{
ctx->indent_level--;
do_indent (ctx);
fputs ("\n}", ctx->fp);
}
开发者ID:Xilinx,项目名称:glibc,代码行数:9,代码来源:json-lib.c
示例19: debug_before_reconstructed
static void
debug_before_reconstructed()
{
do_indent ();
fprintf (ipf->output_fp, "<reconstructed %d name=%s>\n",
iterate_line->index,
iterate_line->name);
indent += 2;
}
开发者ID:EleanorRobson,项目名称:oracc,代码行数:9,代码来源:pf-debug.c
示例20: debug_before_composite
static void
debug_before_composite()
{
do_indent ();
fprintf (ipf->output_fp, "<composite %d name=%s>\n",
iterate_line->index,
iterate_line->name);
indent += 2;
}
开发者ID:EleanorRobson,项目名称:oracc,代码行数:9,代码来源:pf-debug.c
注:本文中的do_indent函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论