This commit is contained in:
2026-08-11 17:00:41 +03:00
parent 4491f27c68
commit c6ee8f6c5b

View File

@@ -75,15 +75,20 @@ public:
error_t fromCharRange(snplib::snplib_input_char_range_c auto&& bytes) error_t fromCharRange(snplib::snplib_input_char_range_c auto&& bytes)
requires(!std::same_as<CharRangeT, std::remove_cvref_t<decltype(bytes)>>) requires(!std::same_as<CharRangeT, std::remove_cvref_t<decltype(bytes)>>)
{ {
if constexpr (requires(CharRangeT t) { t.clear(std::declval<size_t>()); }) { auto err = fromCharRange(
this->_ownByteSeq.clear(); std::forward<decltype(bytes)>(bytes),
} else { {.keyval_delim = ADCLIB_NETMSG_KEYWORD_PARAM_DELIM, .valseq_delim = ADCLIB_NETMSG_PARAM_PARAM_DELIM});
this->_ownByteSeq = CharRangeT();
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) error_t fromCharRange(CharRangeT& bytes)