...
This commit is contained in:
@@ -75,15 +75,20 @@ public:
|
||||
error_t fromCharRange(snplib::snplib_input_char_range_c auto&& bytes)
|
||||
requires(!std::same_as<CharRangeT, std::remove_cvref_t<decltype(bytes)>>)
|
||||
{
|
||||
if constexpr (requires(CharRangeT t) { t.clear(std::declval<size_t>()); }) {
|
||||
this->_ownByteSeq.clear();
|
||||
} else {
|
||||
this->_ownByteSeq = CharRangeT();
|
||||
auto err = fromCharRange(
|
||||
std::forward<decltype(bytes)>(bytes),
|
||||
{.keyval_delim = ADCLIB_NETMSG_KEYWORD_PARAM_DELIM, .valseq_delim = ADCLIB_NETMSG_PARAM_PARAM_DELIM});
|
||||
|
||||
if (err) {
|
||||
return err;
|
||||
}
|
||||
|
||||
std::ranges::copy(std::forward<decltype(bytes)>(bytes), std::back_inserter(this->_ownByteSeq));
|
||||
if (!std::ranges::contains(ADCLIB_NETMSG_VALID_KEYWORDS, key())) {
|
||||
this->_isValid = false;
|
||||
// return an error here!!!
|
||||
}
|
||||
|
||||
return fromCharRange(this->_ownByteSeq);
|
||||
return {};
|
||||
}
|
||||
|
||||
error_t fromCharRange(CharRangeT& bytes)
|
||||
|
||||
Reference in New Issue
Block a user