diff options
Diffstat (limited to 'src/FbTk/StringUtil.hh')
-rw-r--r-- | src/FbTk/StringUtil.hh | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/FbTk/StringUtil.hh b/src/FbTk/StringUtil.hh index 75fa69e..7bc8f80 100644 --- a/src/FbTk/StringUtil.hh +++ b/src/FbTk/StringUtil.hh | |||
@@ -30,6 +30,16 @@ namespace FbTk { | |||
30 | 30 | ||
31 | namespace StringUtil { | 31 | namespace StringUtil { |
32 | 32 | ||
33 | /// \@{ | ||
34 | /// @param in - input string, might be 0xab or 0123 | ||
35 | /// @param out - result if extraction was ok | ||
36 | /// @return 1 - ok, result stored in 'out' | ||
37 | int extractNumber(const std::string& in, unsigned int& out); | ||
38 | int extractNumber(const std::string& in, int& out); | ||
39 | /// \@} | ||
40 | |||
41 | /// creates a number to a string | ||
42 | std::string number2String(int num); | ||
33 | 43 | ||
34 | /// Similar to `strstr' but this function ignores the case of both strings | 44 | /// Similar to `strstr' but this function ignores the case of both strings |
35 | const char *strcasestr(const char *str, const char *ptn); | 45 | const char *strcasestr(const char *str, const char *ptn); |
@@ -84,7 +94,7 @@ static void stringTokensBetween(Container &container, const std::string &in, | |||
84 | while (true) { | 94 | while (true) { |
85 | err = getStringBetween(token, in.c_str() + pos, first, last, ok_chars, | 95 | err = getStringBetween(token, in.c_str() + pos, first, last, ok_chars, |
86 | allow_nesting); | 96 | allow_nesting); |
87 | if (err == 0) | 97 | if (err <= 0) |
88 | break; | 98 | break; |
89 | container.push_back(token); | 99 | container.push_back(token); |
90 | pos += err; | 100 | pos += err; |