Enhancements

- Added text.cpp/ucFirst function to capitalize words, so that "pending"
  can now appear as "Pending" on the info report.  This helps task pass
  many more test cases.
This commit is contained in:
Paul Beckingham 2009-06-16 13:32:11 -04:00
parent 7a2c40626e
commit 78ec411067
3 changed files with 13 additions and 1 deletions

View file

@ -309,7 +309,7 @@ std::string handleInfo ()
table.addCell (row, 0, "ID");
table.addCell (row, 1, task->id);
std::string status = Task::statusToText (task->getStatus ());
std::string status = ucFirst (Task::statusToText (task->getStatus ()));
if (task->has ("parent"))
status += " (Recurring)";

View file

@ -296,6 +296,17 @@ std::string upperCase (const std::string& input)
return output;
}
////////////////////////////////////////////////////////////////////////////////
std::string ucFirst (const std::string& input)
{
std::string output = input;
if (output.length () > 0)
output[0] = ::toupper (output[0]);
return output;
}
////////////////////////////////////////////////////////////////////////////////
const char* optionalBlankLine ()
{

View file

@ -44,6 +44,7 @@ void join (std::string&, const std::string&, const std::vector<std::string>&);
std::string commify (const std::string&);
std::string lowerCase (const std::string&);
std::string upperCase (const std::string&);
std::string ucFirst (const std::string&);
const char* optionalBlankLine ();
void guess (const std::string&, std::vector<std::string>&, std::string&);
bool digitsOnly (const std::string&);