From c6ee8f6c5b40538cbb0c2a4a4bb89034fa9aae7e Mon Sep 17 00:00:00 2001 From: "Timur A. Fatkhullin" Date: Tue, 11 Aug 2026 17:00:41 +0300 Subject: [PATCH] ... --- include/adclib/adclib_netmsg.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/include/adclib/adclib_netmsg.h b/include/adclib/adclib_netmsg.h index 79b064b..f41e428 100644 --- a/include/adclib/adclib_netmsg.h +++ b/include/adclib/adclib_netmsg.h @@ -75,15 +75,20 @@ public: error_t fromCharRange(snplib::snplib_input_char_range_c auto&& bytes) requires(!std::same_as>) { - if constexpr (requires(CharRangeT t) { t.clear(std::declval()); }) { - this->_ownByteSeq.clear(); - } else { - this->_ownByteSeq = CharRangeT(); + auto err = fromCharRange( + std::forward(bytes), + {.keyval_delim = ADCLIB_NETMSG_KEYWORD_PARAM_DELIM, .valseq_delim = ADCLIB_NETMSG_PARAM_PARAM_DELIM}); + + if (err) { + return err; } - std::ranges::copy(std::forward(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)