mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Code Cleanup
- Relocated the Table::getCharLength() from Johannes to text.cpp/characters() because it is a general-purpose function, and will be the start of the UTF8 conversion of all text.cpp code. - Added unit tests for characters().
This commit is contained in:
parent
6e1aa42d1a
commit
2f1c582d7d
5 changed files with 35 additions and 28 deletions
|
@ -31,7 +31,7 @@
|
|||
#include <vector>
|
||||
#include "../auto.h"
|
||||
|
||||
// text.cpp
|
||||
// text.cpp, Non-UTF-8 aware.
|
||||
void wrapText (std::vector <std::string>&, const std::string&, const int);
|
||||
std::string trimLeft (const std::string& in, const std::string& t = " ");
|
||||
std::string trimRight (const std::string& in, const std::string& t = " ");
|
||||
|
@ -60,5 +60,8 @@ std::string::size_type find (const std::string&, const std::string&, bool sensit
|
|||
std::string::size_type find (const std::string&, const std::string&, std::string::size_type, bool sensitive = true);
|
||||
int strippedLength (const std::string&);
|
||||
|
||||
// UTF-8 aware.
|
||||
int characters (const std::string&);
|
||||
|
||||
#endif
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue