aboutsummaryrefslogtreecommitdiff
path: root/bpkg/types-parsers.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2021-04-22 21:57:13 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2021-07-09 14:06:57 +0300
commit5d513688ae07d96910dd1eef83bdad4e9d780373 (patch)
tree402a87bbdb79a5a2392b714553e567465c3415c1 /bpkg/types-parsers.cxx
parent50a5c7b14250dab7941e8b0a67dfe6c442d2c5a9 (diff)
Add support for linked configurations
Diffstat (limited to 'bpkg/types-parsers.cxx')
-rw-r--r--bpkg/types-parsers.cxx25
1 files changed, 25 insertions, 0 deletions
diff --git a/bpkg/types-parsers.cxx b/bpkg/types-parsers.cxx
index be95219..d5ddb28 100644
--- a/bpkg/types-parsers.cxx
+++ b/bpkg/types-parsers.cxx
@@ -67,6 +67,31 @@ namespace bpkg
parse_path (x, s);
}
+ void parser<uuid>::
+ parse (uuid& x, bool& xs, scanner& s)
+ {
+ xs = true;
+
+ const char* o (s.next ());
+
+ if (!s.more ())
+ throw missing_value (o);
+
+ const char* v (s.next ());
+
+ try
+ {
+ x = uuid (v);
+
+ if (x.nil ())
+ throw invalid_value (o, v);
+ }
+ catch (const invalid_argument&)
+ {
+ throw invalid_value (o, v);
+ }
+ }
+
void parser<auth>::
parse (auth& x, bool& xs, scanner& s)
{