From 04c3e9e53792ab541313b0b47837b5457f541da1 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 31 Oct 2015 15:42:32 -0400 Subject: [PATCH] Column: Implemented ::renderStringLeft, ::renderStringRight --- src/columns/Column.cpp | 24 ++++++++++++++++++++++++ src/columns/Column.h | 6 ++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/columns/Column.cpp b/src/columns/Column.cpp index e4b477ac3..963117367 100644 --- a/src/columns/Column.cpp +++ b/src/columns/Column.cpp @@ -292,3 +292,27 @@ void Column::renderDouble ( } //////////////////////////////////////////////////////////////////////////////// +void Column::renderStringLeft ( + std::vector & lines, + int width, + Color& color, + const std::string& value) +{ + lines.push_back ( + color.colorize ( + leftJustify (value, width))); +} + +//////////////////////////////////////////////////////////////////////////////// +void Column::renderStringRight ( + std::vector & lines, + int width, + Color& color, + const std::string& value) +{ + lines.push_back ( + color.colorize ( + rightJustify (value, width))); +} + +//////////////////////////////////////////////////////////////////////////////// diff --git a/src/columns/Column.h b/src/columns/Column.h index 2ff7712f1..903f2db7a 100644 --- a/src/columns/Column.h +++ b/src/columns/Column.h @@ -66,8 +66,10 @@ public: virtual std::string modify (std::string& input) { return input; }; protected: - void renderInteger (std::vector &, int, Color&, int); - void renderDouble (std::vector &, int, Color&, double); + void renderInteger (std::vector &, int, Color&, int); + void renderDouble (std::vector &, int, Color&, double); + void renderStringLeft (std::vector &, int, Color&, const std::string&); + void renderStringRight (std::vector &, int, Color&, const std::string&); protected: std::string _name;