streams: cache file position within AutoFile

This commit is contained in:
Pieter Wuille committed 2024-09-13 07:35:41 -04:00
1 parent 07c7c96022
commit e624a9bef1
8 files changed
+48 -35

No files matched your search

+2 -1
View File
@@ -390,9 +390,10 @@ class AutoFile
protected:
std::FILE* m_file;
std::vector<std::byte> m_xor;
std::optional<int64_t> m_position;
public:
explicit AutoFile(std::FILE* file, std::vector<std::byte> data_xor={}) : m_file{file}, m_xor{std::move(data_xor)} {}
explicit AutoFile(std::FILE* file, std::vector<std::byte> data_xor={});
~AutoFile() { fclose(); }