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:
Paul Beckingham 2010-08-01 13:05:53 -04:00
parent 6e1aa42d1a
commit 2f1c582d7d
5 changed files with 35 additions and 28 deletions

View file

@ -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
////////////////////////////////////////////////////////////////////////////////