aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/utility.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/utility.hxx')
-rw-r--r--libbuild2/utility.hxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/libbuild2/utility.hxx b/libbuild2/utility.hxx
index 4560a73..7dbff2f 100644
--- a/libbuild2/utility.hxx
+++ b/libbuild2/utility.hxx
@@ -798,6 +798,13 @@ namespace build2
{
return apply_pattern (s, p.c_str ());
}
+
+ // Try to parse a string as a non-negative number returning nullopt if the
+ // argument is not a valid number or the number is greater than the
+ // specified maximum.
+ //
+ optional<uint64_t>
+ parse_number (const string&, uint64_t max = UINT64_MAX);
}
#include <libbuild2/utility.ixx>