Code Reorganization

- Changed the ::measure and ::render methods from pure virtual to
  virtual.
- Fixed bug where recur.indicator used the length of the indicator
  instead of the indicator.
- Implemented ColString.{h,cpp} to support generic Views based on
  strings, not tasks.
- Implemented newly virtual Column:: methods.
This commit is contained in:
Paul Beckingham
2011-05-08 17:06:02 -04:00
parent 00125c19d1
commit 590273d4e8
6 changed files with 181 additions and 4 deletions

View File

@@ -38,6 +38,7 @@
#include <ColRecur.h>
#include <ColStart.h>
#include <ColStatus.h>
#include <ColString.h>
#include <ColTags.h>
#include <ColUntil.h>
#include <ColUrgency.h>
@@ -86,8 +87,11 @@ Column* Column::factory (const std::string& name, const std::string& report)
else if (column_name == "urgency") column = new ColumnUrgency ();
else if (column_name == "uuid") column = new ColumnUUID ();
else if (column_name == "wait") column = new ColumnWait ();
// Special non-task column
else if (column_name == "string") column = new ColumnString ();
else
throw std::string ("Unrecognized column name '") + column_name + "'";
throw std::string ("Unrecognized column name '") + column_name + "'.";
column->setReport (report);
column->setStyle (column_style);
@@ -165,3 +169,27 @@ void Column::renderHeader (
}
////////////////////////////////////////////////////////////////////////////////
void Column::measure (const std::string& value, int& minimum, int& maximum)
{
throw std::string ("Virtual method Column::measure not overriden.");
}
////////////////////////////////////////////////////////////////////////////////
void Column::measure (Task& task, int& minimum, int& maximum)
{
throw std::string ("Virtual method Column::measure not overriden.");
}
////////////////////////////////////////////////////////////////////////////////
void Column::render (std::vector <std::string>& lines, const std::string& value, int width, Color& color)
{
throw std::string ("Virtual method Column::render not overriden.");
}
////////////////////////////////////////////////////////////////////////////////
void Column::render (std::vector <std::string>& lines, Task& task, int width, Color& color)
{
throw std::string ("Virtual method Column::render not overriden.");
}
////////////////////////////////////////////////////////////////////////////////