rename record_printer to RecordPrinter
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#include "record_printer.hpp"
|
||||
#include "RecordPrinter.hpp"
|
||||
|
||||
#include "matador/utils/basic_types.hpp"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <iomanip>
|
||||
|
||||
namespace matador::test {
|
||||
record_printer::record_printer(std::ostream &os)
|
||||
RecordPrinter::RecordPrinter(std::ostream &os)
|
||||
: os_(os) {
|
||||
type_widths_ = {
|
||||
{utils::basic_type::Int8, 4},
|
||||
@@ -32,7 +32,7 @@ record_printer::record_printer(std::ostream &os)
|
||||
};
|
||||
}
|
||||
|
||||
void record_printer::print_header(const sql::record &rec) const {
|
||||
void RecordPrinter::print_header(const sql::record &rec) const {
|
||||
for (const auto &f: rec.columns()) {
|
||||
os_ << std::left << std::setw(width(f)) << f.name() << " ";
|
||||
}
|
||||
@@ -44,14 +44,14 @@ void record_printer::print_header(const sql::record &rec) const {
|
||||
os_ << "\n";
|
||||
}
|
||||
|
||||
void record_printer::print(const sql::record &rec) const {
|
||||
void RecordPrinter::print(const sql::record &rec) const {
|
||||
for (const auto &f: rec.columns()) {
|
||||
os_ << std::left << std::setw(width(f)) << f.str() << " ";
|
||||
}
|
||||
os_ << "\n";
|
||||
}
|
||||
|
||||
int record_printer::width(const sql::field &f) {
|
||||
int RecordPrinter::width(const sql::field &f) {
|
||||
// If it's a varchar/string and has a defined size, use it if it's reasonable,
|
||||
// otherwise fall back to type defaults.
|
||||
if ((f.is_varchar() || f.is_string()) && f.size() > 0 && f.size() < 100) {
|
||||
@@ -12,9 +12,9 @@ class record;
|
||||
}
|
||||
|
||||
namespace matador::test {
|
||||
class record_printer final {
|
||||
class RecordPrinter final {
|
||||
public:
|
||||
explicit record_printer(std::ostream &os);
|
||||
explicit RecordPrinter(std::ostream &os);
|
||||
|
||||
void print_header(const sql::record &rec) const;
|
||||
void print(const sql::record &rec) const;
|
||||
Reference in New Issue
Block a user