mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Text Handling
- Migrated the splitq implementation over to the Lexer. Now it handles all Unicode spaces. Jsut need to obsolete the old version.
This commit is contained in:
parent
45453de477
commit
d099a4edfd
3 changed files with 28 additions and 1 deletions
16
src/text.cpp
16
src/text.cpp
|
@ -34,6 +34,7 @@
|
|||
#include <strings.h>
|
||||
#include <ctype.h>
|
||||
#include <Context.h>
|
||||
#include <Lexer.h>
|
||||
#include <math.h>
|
||||
#include <util.h>
|
||||
#include <text.h>
|
||||
|
@ -62,6 +63,21 @@ void wrapText (
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// UTF-8
|
||||
//
|
||||
// Splits on unicode whitespace, removeѕ quotes.
|
||||
void splitq (std::vector <std::string>& results, const std::string& input)
|
||||
{
|
||||
results.clear ();
|
||||
|
||||
std::string token;
|
||||
Lexer::Type type;
|
||||
Lexer lex (input);
|
||||
while (lex.token (token, type))
|
||||
results.push_back (token);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// TODO Obsolete this call.
|
||||
void splitq (
|
||||
std::vector<std::string>& results,
|
||||
const std::string& input,
|
||||
|
|
|
@ -39,6 +39,7 @@ std::string unquoteText (const std::string&);
|
|||
int longestWord (const std::string&);
|
||||
int longestLine (const std::string&);
|
||||
bool extractLine (std::string&, const std::string&, int, bool, unsigned int&);
|
||||
void splitq (std::vector<std::string>&, const std::string&);
|
||||
void splitq (std::vector<std::string>&, const std::string&, const char);
|
||||
void split (std::vector<std::string>&, const std::string&, const char);
|
||||
void split (std::vector<std::string>&, const std::string&, const std::string&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue