| 1 |
#ifndef HEADER_STRINGTOOL_H |
| 2 |
#define HEADER_STRINGTOOL_H |
| 3 |
|
| 4 |
#include <string> |
| 5 |
#include <vector> |
| 6 |
|
| 7 |
/** |
| 8 |
* String utils. |
| 9 |
*/ |
| 10 |
class StringTool { |
| 11 |
public: |
| 12 |
typedef std::vector<std::string> t_args; |
| 13 |
public: |
| 14 |
static long readInt(const char *text, bool *ok); |
| 15 |
static std::string toString(long value); |
| 16 |
|
| 17 |
static bool startsWith(const std::string &str, |
| 18 |
const std::string &prefix); |
| 19 |
static void replace(std::string &buffer, |
| 20 |
const std::string &pattern, const std::string &newstring); |
| 21 |
static t_args split(const std::string &str, char separator); |
| 22 |
static int utf8Length(const std::string &str); |
| 23 |
}; |
| 24 |
|
| 25 |
#endif |
| 26 |
|