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:
@@ -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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user