MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / AddColumnHeader

Method AddColumnHeader

lib/mdflib/mdfviewer/src/util/csvwriter.cpp:80–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78bool CsvWriter::IsOk() const { return file_.is_open(); }
79
80void CsvWriter::AddColumnHeader(const std::string &name,
81 const std::string &unit, bool valid) {
82 if (row_count_ != 0) {
83 LOG_ERROR() << "Column headers shall be added to first row. File: "
84 << filename_;
85 return;
86 }
87 header_list_.emplace_back(Header{name, unit, valid});
88 std::ostringstream header;
89 header << name;
90 if (!unit.empty()) {
91 header << " [" << unit << "]";
92 }
93 SaveText(header.str());
94 max_columns_ = std::max(column_count_, max_columns_);
95}
96
97void CsvWriter::SaveText(const std::string &text) {
98 if (output_ == nullptr) {

Callers 1

CreateCsvFileFunction · 0.80

Calls 1

emptyMethod · 0.80

Tested by

no test coverage detected