summaryrefslogtreecommitdiff
path: root/src/FbTk/StringUtil.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/StringUtil.hh')
-rw-r--r--src/FbTk/StringUtil.hh8
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
29namespace FbTk { 31namespace FbTk {
30 32
31namespace StringUtil { 33namespace 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
68void getFirstWord(const std::string &in, std::string &first, std::string &rest); 70void getFirstWord(const std::string &in, std::string &first, std::string &rest);
69 71
72template <typename T>
73void fromString(const char *in, T &out) {
74 FbTk_istringstream iss(in);
75 iss >> out;
76}
77
70template <typename Container> 78template <typename Container>
71static void stringTokensBetween(Container &container, const std::string &in, 79static void stringTokensBetween(Container &container, const std::string &in,
72 std::string &rest, char first, char last, 80 std::string &rest, char first, char last,