The bt2c::Uuid(bt2s::string_view) constructor wants the conversion
to work.
This new static method calls bt_uuid_from_str() directly and uses its
return value to validate the UUID string.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I279ac6521b805b0085247c8fbeb16c9ed5018e51
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12762
return this->_view().isNil();
}
+ static bool isValidUuidStr(const bt2s::string_view str) noexcept
+ {
+ std::array<Val, Uuid::size()> tmp;
+
+ return bt_uuid_from_str(str.data(), str.data() + str.size(), tmp.data()) == 0;
+ }
+
private:
/*
* std::copy_n() won't throw when simply copying bytes below,