Lexer: Migrated commify, ucFirst and lowerCase from text to Lexer
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <Context.h>
|
||||
#include <ViewText.h>
|
||||
#include <Lexer.h>
|
||||
#include <i18n.h>
|
||||
#include <text.h>
|
||||
#include <util.h>
|
||||
@@ -98,7 +99,7 @@ int CmdCalendar::execute (std::string& output)
|
||||
// Set up a vector of months, for autoComplete.
|
||||
std::vector <std::string> monthNames;
|
||||
for (int i = 1; i <= 12; ++i)
|
||||
monthNames.push_back (lowerCase (ISO8601d::monthName (i)));
|
||||
monthNames.push_back (Lexer::lowerCase (ISO8601d::monthName (i)));
|
||||
|
||||
// For autoComplete results.
|
||||
std::vector <std::string> matches;
|
||||
@@ -113,15 +114,15 @@ int CmdCalendar::execute (std::string& output)
|
||||
for (auto& arg : words)
|
||||
{
|
||||
// Some version of "calendar".
|
||||
if (autoComplete (lowerCase (arg), commandNames, matches, context.config.getInteger ("abbreviation.minimum")) == 1)
|
||||
if (autoComplete (Lexer::lowerCase (arg), commandNames, matches, context.config.getInteger ("abbreviation.minimum")) == 1)
|
||||
continue;
|
||||
|
||||
// "due".
|
||||
else if (autoComplete (lowerCase (arg), keywordNames, matches, context.config.getInteger ("abbreviation.minimum")) == 1)
|
||||
else if (autoComplete (Lexer::lowerCase (arg), keywordNames, matches, context.config.getInteger ("abbreviation.minimum")) == 1)
|
||||
getpendingdate = true;
|
||||
|
||||
// "y".
|
||||
else if (lowerCase (arg) == "y")
|
||||
else if (Lexer::lowerCase (arg) == "y")
|
||||
argWholeYear = true;
|
||||
|
||||
// YYYY.
|
||||
@@ -137,7 +138,7 @@ int CmdCalendar::execute (std::string& output)
|
||||
}
|
||||
|
||||
// "January" etc.
|
||||
else if (autoComplete (lowerCase (arg), monthNames, matches, context.config.getInteger ("abbreviation.minimum")) == 1)
|
||||
else if (autoComplete (Lexer::lowerCase (arg), monthNames, matches, context.config.getInteger ("abbreviation.minimum")) == 1)
|
||||
{
|
||||
argMonth = ISO8601d::monthOfYear (matches[0]);
|
||||
if (argMonth == -1)
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <cmake.h>
|
||||
#include <CmdEdit.h>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <stdlib.h>
|
||||
@@ -33,6 +34,7 @@
|
||||
#include <unistd.h>
|
||||
#include <ISO8601.h>
|
||||
#include <Context.h>
|
||||
#include <Lexer.h>
|
||||
#include <Filter.h>
|
||||
#include <Nibbler.h>
|
||||
#include <i18n.h>
|
||||
@@ -40,7 +42,6 @@
|
||||
#include <util.h>
|
||||
#include <i18n.h>
|
||||
#include <main.h>
|
||||
#include <CmdEdit.h>
|
||||
#include <JSON.h>
|
||||
|
||||
extern Context context;
|
||||
@@ -213,12 +214,12 @@ std::string CmdEdit::formatTask (Task task, const std::string& dateformat)
|
||||
|
||||
before << "# " << STRING_EDIT_TABLE_HEADER_1 << "\n"
|
||||
<< "# " << STRING_EDIT_TABLE_HEADER_2 << "\n"
|
||||
<< "# ID: " << task.id << "\n"
|
||||
<< "# UUID: " << task.get ("uuid") << "\n"
|
||||
<< "# Status: " << ucFirst (Task::statusToText (task.getStatus ())) << "\n" // L10N safe ucFirst.
|
||||
<< "# Mask: " << task.get ("mask") << "\n"
|
||||
<< "# iMask: " << task.get ("imask") << "\n"
|
||||
<< " Project: " << task.get ("project") << "\n";
|
||||
<< "# ID: " << task.id << "\n"
|
||||
<< "# UUID: " << task.get ("uuid") << "\n"
|
||||
<< "# Status: " << Lexer::ucFirst (Task::statusToText (task.getStatus ())) << "\n"
|
||||
<< "# Mask: " << task.get ("mask") << "\n"
|
||||
<< "# iMask: " << task.get ("imask") << "\n"
|
||||
<< " Project: " << task.get ("project") << "\n";
|
||||
|
||||
std::vector <std::string> tags;
|
||||
task.getTags (tags);
|
||||
|
||||
@@ -119,7 +119,7 @@ int CmdInfo::execute (std::string& output)
|
||||
view.set (row, 0, STRING_COLUMN_LABEL_ID);
|
||||
view.set (row, 1, (task.id ? format (task.id) : "-"));
|
||||
|
||||
std::string status = ucFirst (Task::statusToText (task.getStatus ())); // L10N safe ucFirst.
|
||||
std::string status = Lexer::ucFirst (Task::statusToText (task.getStatus ()));
|
||||
|
||||
// description
|
||||
Color c;
|
||||
|
||||
Reference in New Issue
Block a user