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

Method ignore

src/streams.cpp:81–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81void AutoFile::ignore(size_t nSize)
82{
83 if (!m_file) throw std::ios_base::failure("AutoFile::ignore: file handle is nullptr");
84 unsigned char data[4096];
85 while (nSize > 0) {
86 size_t nNow = std::min<size_t>(nSize, sizeof(data));
87 if (std::fread(data, 1, nNow, m_file) != nNow) {
88 throw std::ios_base::failure(feof() ? "AutoFile::ignore: end of file" : "AutoFile::ignore: fread failed");
89 }
90 nSize -= nNow;
91 if (m_position.has_value()) *m_position += nNow;
92 }
93}
94
95void AutoFile::write(std::span<const std::byte> src)
96{

Callers 14

UnserializeV2StreamMethod · 0.45
ProcessMessageMethod · 0.45
UnserMethod · 0.45
UnserializeMethod · 0.45
UnserializeMethod · 0.45
UnserializeMethod · 0.45
BOOST_AUTO_TEST_CASEFunction · 0.45
FUZZ_TARGETFunction · 0.45
closeEventMethod · 0.45
closeEventMethod · 0.45
keyPressEventMethod · 0.45
changeEventMethod · 0.45

Calls 1

has_valueMethod · 0.45

Tested by 2

BOOST_AUTO_TEST_CASEFunction · 0.36
FUZZ_TARGETFunction · 0.36