aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/utility.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-10-10 17:22:46 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-11-06 19:32:09 +0300
commitf41599c8e9435f3dfec60b872c2b4ae31177efdd (patch)
tree088f8d9bf906e4a2ed734e034699163c9ccc7306 /libbuild2/utility.hxx
parentac76a4fd2afff48a0d5db84592babe5cabef3a2c (diff)
Add support for test timeouts
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>