MCPcopy Create free account
hub / github.com/LAStools/LAStools / write_full_csv

Function write_full_csv

src/lasinfo.cpp:514–531  ·  view source on GitHub ↗

Write all input files into one csv file, header and all rows

Source from the content-addressed store, hash-verified

512
513/// Write all input files into one csv file, header and all rows
514static void write_full_csv(FILE* file_out, const std::vector<FileMap>& all_files) {
515 if (!file_out || all_files.empty()) return;
516
517 // collect keys for header
518 std::vector<std::string> keys = collect_all_keys(all_files);
519
520 // write keys in header
521 for (size_t i = 0; i < keys.size(); ++i) {
522 fprintf(file_out, "%s", escape_csv_value(keys[i]).c_str());
523 if (i + 1 < keys.size()) fprintf(file_out, ";");
524 }
525 fprintf(file_out, "\n");
526
527 // write values (per file) into the columne
528 for (const FileMap& file : all_files) {
529 write_csv_row(file_out, file, keys);
530 }
531}
532
533/// Adds a new entry to a string and separates it with ';' if necessary
534static void append_with_separator(std::string& target, const std::string& text, const std::string separator) {

Callers 1

runMethod · 0.85

Calls 5

collect_all_keysFunction · 0.85
escape_csv_valueFunction · 0.85
write_csv_rowFunction · 0.85
emptyMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected