summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2014-06-24 18:36:13 -0700
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2014-06-24 18:36:13 -0700
commitcdef8390db6407608634b5a6c31234e34dfe5018 (patch)
treefb3859898cf6166c1b67b09bfdc5930e65300da6
parent7ec2782ca7f56377011c2620287639f70655c8c3 (diff)
Adding a few string conversion accessors.
-rw-r--r--includes/BString.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/includes/BString.h b/includes/BString.h
index dc9fd5d..447ba93 100644
--- a/includes/BString.h
+++ b/includes/BString.h
@@ -69,6 +69,9 @@ class String : private std::string {
}
int to_int(int base = 0) const { return strtol(to_charp(), NULL, base); }
+ unsigned to_uint(int base = 0) const { return strtoul(to_charp(), NULL, base); }
+ int64_t to_int64(int base = 0) const { return strtoll(to_charp(), NULL, base); }
+ uint64_t to_uint64(int base = 0) const { return strtoull(to_charp(), NULL, base); }
double to_double() const { return strtod(to_charp(), NULL); }
typedef std::vector<String> List;
List split(char c);