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

Method size

src/streams.cpp:60–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60int64_t AutoFile::size()
61{
62 if (IsNull()) {
63 throw std::ios_base::failure("AutoFile::size: file handle is nullptr");
64 }
65 // Temporarily save the current position
66 int64_t current_pos = tell();
67 seek(0, SEEK_END);
68 int64_t file_size = tell();
69 // Restore the original position
70 seek(current_pos, SEEK_SET);
71 return file_size;
72}
73
74void AutoFile::read(std::span<std::byte> dst)
75{

Callers 4

detail_freadMethod · 0.45
readMethod · 0.45
writeMethod · 0.45
write_bufferMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected