Add Keyboard input and enter support for text editor.

This commit is contained in:
James Grogan 2022-11-17 13:13:01 +00:00
parent cf9bace272
commit 9301769d58
23 changed files with 315 additions and 121 deletions

View file

@ -20,6 +20,17 @@ bool StringUtils::IsSpace(char c)
return std::isspace(c, loc);
}
std::vector<std::string> StringUtils::toLines(const std::string& input)
{
auto result = std::vector<std::string>{};
auto ss = std::stringstream{input};
for (std::string line; std::getline(ss, line, '\n');)
{
result.push_back(line);
}
return result;
}
std::string StringUtils::strip(const std::string& input)
{
if (input.empty())

View file

@ -23,5 +23,8 @@ public:
static std::string ToPaddedString(unsigned numBytes, unsigned entry);
static std::vector<std::string> split(const std::string& input);
static std::string strip(const std::string& input);
static std::vector<std::string> toLines(const std::string& input);
static std::string stripQuotes(const std::string& input);
};