Joedb 9.5.0
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
Readonly_Interpreted_File.cpp
Go to the documentation of this file.
2#include "joedb/Multiplexer.h"
4
5namespace joedb
6{
7 ////////////////////////////////////////////////////////////////////////////
9 ////////////////////////////////////////////////////////////////////////////
10 (
11 std::istream &stream,
12 bool readonly
13 ):
14 journal(*this)
15 {
16 if (!stream)
17 throw Exception("opening interpreted file: !stream");
18
19 stream.exceptions(std::ios::badbit);
20
21 Multiplexer multiplexer{db, journal};
22 Interpreter interpreter(db, multiplexer, nullptr, multiplexer, 0);
23 interpreter.set_echo(false);
24 interpreter.set_rethrow(true);
25 {
26 std::ofstream null_stream;
27 interpreter.main_loop(stream, null_stream);
28 }
30
31 if (readonly)
33 }
34
35 ////////////////////////////////////////////////////////////////////////////
37 ////////////////////////////////////////////////////////////////////////////
38}
void main_loop(std::istream &in, std::ostream &out)
void set_rethrow(bool new_rethrow)
Readonly_Interpreted_File(std::istream &stream, bool readonly)
void soft_checkpoint()
Definition Writable.h:21
Definition Blob.h:7