summaryrefslogtreecommitdiff
path: root/src/util/NumberParser.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-06-06 13:14:31 +0200
committerMax Kellermann <max@musicpd.org>2019-06-06 13:26:30 +0200
commit72a0aeb26517ee41e9f219154d9608074e275d1a (patch)
tree38efaab4b0db7d4eed502de8c2f4373ef8a55406 /src/util/NumberParser.hxx
parente556cd20f7ec13ca9802fe7d74a6a29312dd8d10 (diff)
util/NumberParser: add overload with StringView
Diffstat (limited to 'src/util/NumberParser.hxx')
-rw-r--r--src/util/NumberParser.hxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/util/NumberParser.hxx b/src/util/NumberParser.hxx
index d514e9dc9..12a1040ec 100644
--- a/src/util/NumberParser.hxx
+++ b/src/util/NumberParser.hxx
@@ -35,6 +35,8 @@
#include <stdint.h>
#include <stdlib.h>
+struct StringView;
+
static inline unsigned
ParseUnsigned(const char *p, char **endptr=nullptr, int base=10) noexcept
{
@@ -67,6 +69,9 @@ ParseInt64(const char *p, char **endptr=nullptr, int base=10) noexcept
return strtoll(p, endptr, base);
}
+int64_t
+ParseInt64(StringView s, const char **endptr_r=nullptr, int base=10) noexcept;
+
static inline double
ParseDouble(const char *p, char **endptr=nullptr) noexcept
{