mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Code Cleanup
- Removed obsolete text.cpp splitq funciton, which is superceded by Lexer::split.
This commit is contained in:
parent
b0b176827e
commit
d99f40eaad
3 changed files with 1 additions and 54 deletions
41
src/text.cpp
41
src/text.cpp
|
@ -61,47 +61,6 @@ void wrapText (
|
|||
lines.push_back (line);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// UTF-8
|
||||
void splitq (
|
||||
std::vector<std::string>& results,
|
||||
const std::string& input,
|
||||
const char delimiter)
|
||||
{
|
||||
results.clear ();
|
||||
|
||||
std::string::size_type start = 0;
|
||||
std::string::size_type i = 0;
|
||||
std::string word;
|
||||
bool in_quote = false;
|
||||
char quote;
|
||||
|
||||
while (utf8_next_char (input, i))
|
||||
{
|
||||
if (in_quote)
|
||||
{
|
||||
if (input[i] == quote)
|
||||
in_quote = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (input[i] == delimiter)
|
||||
{
|
||||
results.push_back (unquoteText (input.substr (start, i - start)));
|
||||
start = i + 1;
|
||||
}
|
||||
else if (input[i] == '\'' ||
|
||||
input[i] == '"')
|
||||
{
|
||||
quote = input[i];
|
||||
in_quote = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
results.push_back (unquoteText (input.substr (start)));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void split (
|
||||
std::vector<std::string>& results,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue