summaryrefslogtreecommitdiff
path: root/src/string.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2012-06-27 14:26:29 +0200
committerMaxime Coste <frrrwww@gmail.com>2012-06-27 14:26:29 +0200
commitecb3a737a9133440af2026a0caa668a1516911a0 (patch)
treedeb1d9b8f6b1870aec1d799392169528ccbc3740 /src/string.cc
parentae590f35d86ecbfeaf1e471d5cb2590174722c97 (diff)
Tweak String class, and cleanup usages
remove String::clear, add operator=(String&&) add str_to_int(const String&) to replace atoi.
Diffstat (limited to 'src/string.cc')
-rw-r--r--src/string.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/string.cc b/src/string.cc
index 30654256..9e2d1507 100644
--- a/src/string.cc
+++ b/src/string.cc
@@ -25,6 +25,11 @@ String int_to_str(int value)
return String(buffer + pos);
}
+int str_to_int(const String& str)
+{
+ return atoi(str.c_str());
+}
+
std::vector<String> split(const String& str, Character separator)
{
auto begin = str.begin();