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-01 11:19:12 +0300
commitd77ca8720df495017139a24a59c502f53c07df9f (patch)
tree5093b9700607e0db35d6260ad766e7f171e2bf8f /bpkg/types-parsers.cxx
parentaee787bce2b94a057ad8e6fd42e2cd901776e348 (diff)
Add support for associated 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)
{