29 str_.append(reinterpret_cast<char const*>(bytes.
data()), bytes.
size());
44 template <
class Derived,
class BufType>
49 auto keepReading = [&bytesRead, termChar, maxLength](
uint8_t byte) {
50 if (byte == termChar) {
54 if (bytesRead >= maxLength) {
55 throw std::length_error(
"string overflow");
60 auto result = readWhile(keepReading);
63 throw_exception<std::out_of_range>(
"terminator not found");
70 template <
class Derived,
class BufType>
71 template <
typename Predicate>
73 const Predicate& predicate) {
75 readWhile(predicate, s);
79 template <
class Derived,
class BufType>
80 template <
typename Predicate,
typename Output>
82 const Predicate& predicate,
85 auto peeked = peekBytes();
89 for (
size_t idx = 0; idx < peeked.size(); ++idx) {
90 if (!predicate(peeked[idx])) {
91 peeked.reset(peeked.data(), idx);
102 template <
class Derived,
class BufType>
103 template <
typename Predicate>
106 readWhile(predicate, appender);
constexpr detail::Map< Move > move
constexpr size_type size() const
—— Concurrent Priority Queue Implementation ——
detail::Skip skip(size_t count)
void skipWhile(const Predicate &predicate)
constexpr Iter data() const
std::string extractString()
std::string readWhile(const Predicate &predicate)
void append(ByteRange bytes)
std::string readTerminatedString(char termChar= '\0', size_t maxLength=std::numeric_limits< size_t >::max())