MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / ReadLength

Method ReadLength

src/util/string.cpp:60–67  ·  view source on GitHub ↗

Ignores max_line_length but won't overflow

Source from the content-addressed store, hash-verified

58
59// Ignores max_line_length but won't overflow
60std::string_view LineReader::ReadLength(size_t len)
61{
62 if (len == 0) return {};
63 if (Remaining() < len) throw std::runtime_error("Not enough data in buffer");
64 std::string_view out(reinterpret_cast<const char*>(std::to_address(it)), len);
65 it += len;
66 return out;
67}
68
69size_t LineReader::Remaining() const
70{

Callers 2

LoadBodyMethod · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80

Calls

no outgoing calls

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.64