refactored record classe
This commit is contained in:
@@ -33,22 +33,19 @@ record_printer::record_printer(std::ostream &os)
|
||||
}
|
||||
|
||||
void record_printer::print_header(const sql::record &rec) const {
|
||||
for (const auto &f_ref: rec.columns()) {
|
||||
const auto &f = f_ref.get();
|
||||
for (const auto &f: rec.columns()) {
|
||||
os_ << std::left << std::setw(width(f)) << f.name() << " ";
|
||||
}
|
||||
os_ << "\n";
|
||||
|
||||
for (const auto &f_ref: rec.columns()) {
|
||||
const auto &f = f_ref.get();
|
||||
for (const auto &f: rec.columns()) {
|
||||
os_ << std::string(width(f), '-') << " ";
|
||||
}
|
||||
os_ << "\n";
|
||||
}
|
||||
|
||||
void record_printer::print(const sql::record &rec) const {
|
||||
for (const auto &f_ref: rec.columns()) {
|
||||
const auto &f = f_ref.get();
|
||||
for (const auto &f: rec.columns()) {
|
||||
os_ << std::left << std::setw(width(f)) << f.str() << " ";
|
||||
}
|
||||
os_ << "\n";
|
||||
|
||||
Reference in New Issue
Block a user