Lexer: Migrated commify, ucFirst and lowerCase from text to Lexer

This commit is contained in:
Paul Beckingham 2015-10-30 10:57:14 -04:00
parent 7119c42780
commit 51def4b12b
15 changed files with 169 additions and 163 deletions

View file

@ -51,6 +51,7 @@
#include <signal.h>
#include <sys/select.h>
#include <Lexer.h>
#include <text.h>
#include <main.h>
#include <i18n.h>
@ -89,7 +90,7 @@ bool confirm (const std::string& question)
std::string answer {""};
std::getline (std::cin, answer);
context.debug ("STDIN '" + answer + "'");
answer = std::cin.eof () ? STRING_UTIL_CONFIRM_NO : lowerCase (trim (answer));
answer = std::cin.eof () ? STRING_UTIL_CONFIRM_NO : Lexer::lowerCase (trim (answer));
autoComplete (answer, options, matches, 1); // Hard-coded 1.
}
@ -129,7 +130,7 @@ int confirm4 (const std::string& question)
std::string answer {""};
std::getline (std::cin, answer);
context.debug ("STDIN '" + answer + "'");
answer = std::cin.eof () ? STRING_UTIL_CONFIRM_QUIT : lowerCase (trim (answer));
answer = std::cin.eof () ? STRING_UTIL_CONFIRM_QUIT : Lexer::lowerCase (trim (answer));
autoComplete (answer, options, matches, 1); // Hard-coded 1.
}
while (! std::cin.eof () && matches.size () != 1);
@ -159,7 +160,7 @@ std::string formatBytes (size_t bytes)
else if (bytes >= 995) sprintf (formatted, "%.1f %s", (bytes / 1000.0), STRING_UTIL_KIBIBYTES);
else sprintf (formatted, "%d %s", (int)bytes, STRING_UTIL_BYTES);
return commify (formatted);
return Lexer::commify (formatted);
}
////////////////////////////////////////////////////////////////////////////////