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

Method detail_fread

src/streams.cpp:21–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19}
20
21std::size_t AutoFile::detail_fread(std::span<std::byte> dst)
22{
23 if (!m_file) throw std::ios_base::failure("AutoFile::read: file handle is nullptr");
24 const size_t ret = std::fread(dst.data(), 1, dst.size(), m_file);
25 if (m_obfuscation) {
26 if (!m_position) throw std::ios_base::failure("AutoFile::read: position unknown");
27 m_obfuscation(dst.subspan(0, ret), *m_position);
28 }
29 if (m_position) *m_position += ret;
30 return ret;
31}
32
33void AutoFile::seek(int64_t offset, int origin)
34{

Callers 2

FillMethod · 0.80
readMethod · 0.80

Calls 2

dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected