From cdef8390db6407608634b5a6c31234e34dfe5018 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Tue, 24 Jun 2014 18:36:13 -0700 Subject: Adding a few string conversion accessors. --- includes/BString.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'includes/BString.h') 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 List; List split(char c); -- cgit v1.2.3