MCPcopy Create free account
hub / github.com/DFHack/dfhack / write_blueprint

Function write_blueprint

plugins/blueprint.cpp:1493–1513  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1491}
1492
1493static bool write_blueprint(color_ostream &out,
1494 map<string, ofstream*> &output_files,
1495 const blueprint_options &opts,
1496 const blueprint_processor &processor,
1497 bool pretty, int32_t ordinal) {
1498 string fname;
1499 if (!get_filename(fname, out, opts, processor.phase, ordinal))
1500 return false;
1501 if (!output_files.count(fname))
1502 output_files[fname] = new ofstream(fname, ofstream::trunc);
1503
1504 ofstream &ofile = *output_files[fname];
1505 ofile << get_modeline(out, opts, processor.mode, processor.phase) << endl;
1506
1507 if (pretty)
1508 write_pretty(ofile, opts, processor.mapdata);
1509 else
1510 write_minimal(ofile, opts, processor.mapdata);
1511
1512 return true;
1513}
1514
1515static void write_meta_blueprint(color_ostream &out,
1516 map<string, ofstream*> &output_files,

Callers 1

do_transformFunction · 0.85

Calls 5

get_filenameFunction · 0.85
get_modelineFunction · 0.85
write_prettyFunction · 0.85
write_minimalFunction · 0.85
countMethod · 0.45

Tested by

no test coverage detected