diff options
Diffstat (limited to 'src/FbTk/StringUtil.hh')
-rw-r--r-- | src/FbTk/StringUtil.hh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/FbTk/StringUtil.hh b/src/FbTk/StringUtil.hh index bca48bc..416db0d 100644 --- a/src/FbTk/StringUtil.hh +++ b/src/FbTk/StringUtil.hh | |||
@@ -26,6 +26,8 @@ | |||
26 | 26 | ||
27 | #include <string> | 27 | #include <string> |
28 | 28 | ||
29 | #include "stringstream.hh" | ||
30 | |||
29 | namespace FbTk { | 31 | namespace FbTk { |
30 | 32 | ||
31 | namespace StringUtil { | 33 | namespace StringUtil { |
@@ -67,6 +69,12 @@ std::string::size_type removeTrailingWhitespace(std::string &str); | |||
67 | /// splits input at first non-leading whitespace and returns both parts | 69 | /// splits input at first non-leading whitespace and returns both parts |
68 | void getFirstWord(const std::string &in, std::string &first, std::string &rest); | 70 | void getFirstWord(const std::string &in, std::string &first, std::string &rest); |
69 | 71 | ||
72 | template <typename T> | ||
73 | void fromString(const char *in, T &out) { | ||
74 | FbTk_istringstream iss(in); | ||
75 | iss >> out; | ||
76 | } | ||
77 | |||
70 | template <typename Container> | 78 | template <typename Container> |
71 | static void stringTokensBetween(Container &container, const std::string &in, | 79 | static void stringTokensBetween(Container &container, const std::string &in, |
72 | std::string &rest, char first, char last, | 80 | std::string &rest, char first, char last, |