diff options
Diffstat (limited to 'src/FbTk/StringUtil.cc')
-rw-r--r-- | src/FbTk/StringUtil.cc | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/FbTk/StringUtil.cc b/src/FbTk/StringUtil.cc index 182233b..0a7ebd3 100644 --- a/src/FbTk/StringUtil.cc +++ b/src/FbTk/StringUtil.cc | |||
@@ -123,9 +123,27 @@ int extractNumber(const std::string& in, unsigned int& out) { | |||
123 | return ::extractUnsignedNumber<unsigned int>(in, out); | 123 | return ::extractUnsignedNumber<unsigned int>(in, out); |
124 | } | 124 | } |
125 | 125 | ||
126 | std::string number2String(int num) { | 126 | int extractNumber(const std::string& in, long& out) { |
127 | return ::extractSignedNumber<long>(in, out); | ||
128 | } | ||
129 | |||
130 | int extractNumber(const std::string& in, unsigned long& out) { | ||
131 | return ::extractUnsignedNumber<unsigned long>(in, out); | ||
132 | } | ||
133 | |||
134 | int extractNumber(const std::string& in, long long& out) { | ||
135 | return ::extractSignedNumber<long long>(in, out); | ||
136 | } | ||
137 | |||
138 | int extractNumber(const std::string& in, unsigned long long& out) { | ||
139 | return ::extractUnsignedNumber<unsigned long long>(in, out); | ||
140 | } | ||
141 | |||
142 | |||
143 | |||
144 | std::string number2String(long long num) { | ||
127 | char s[128]; | 145 | char s[128]; |
128 | sprintf(s, "%d", num); | 146 | sprintf(s, "%lld", num); |
129 | return std::string(s); | 147 | return std::string(s); |
130 | } | 148 | } |
131 | 149 | ||