6 void Abstract_Interpreted_File::read_data()
11 ios.seekp(0, std::ios::end);
17 "Interpreted_File: last line of joedbi file must be empty"
31 reading_multiplexer{db, journal},
32 interpreter(db, reading_multiplexer,
Record_Id::null),
33 interpreter_writable(ios, db),
34 writing_multiplexer{interpreter_writable, db},
36 null_filebuf(null_file),
37 null_stream(&null_filebuf)
60 return memory_file.pread(data, size, offset);
72 memory_file.pwrite(buffer, size, offset);
76 journal.play_until_checkpoint(writing_multiplexer);
78 ios.seekg(0, std::ios::end);
virtual void shared_lock(int64_t start, int64_t size)
Lock a range of bytes for reading (prevents writes, not reads)
virtual void unlock(int64_t start, int64_t size) noexcept
Remove a lock. The range should match the range of a corresponding lock.
virtual void sync()
Write data durably (including file-size change)
virtual void exclusive_lock(int64_t start, int64_t size)
Lock a range of bytes for writing (prevents both writes and reads)
void sync() override
Write data durably (including file-size change)
size_t pread(char *data, size_t size, int64_t offset) const override
Read a range of bytes.
Abstract_Interpreted_File(Abstract_File &file)
void pwrite(const char *buffer, size_t size, int64_t offset) override
Write a range of bytes. Extend file size if necessary.
int64_t get_size() const override
Get the size of the file, or -1 if it is unknown.
void shared_lock(int64_t start, int64_t size) override
Lock a range of bytes for reading (prevents writes, not reads)
void unlock(int64_t start, int64_t size) noexcept override
Remove a lock. The range should match the range of a corresponding lock.
void exclusive_lock(int64_t start, int64_t size) override
Lock a range of bytes for writing (prevents both writes and reads)
void main_loop(std::istream &in, std::ostream &out)
void set_echo(bool new_echo)
bool is_last_line_empty() const
void set_rethrow(bool new_rethrow)
int64_t get_size() const override
Get the size of the file, or -1 if it is unknown.
void soft_checkpoint() override
https://en.cppreference.com/w/cpp/io/basic_streambuf.html
Abstract_File & get_file()
@ create_new
fails if already exists, locks the file for writing