Joedb 10.0.1
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 file_view(*this),
15 journal(file_view)
16 {
17 if (!stream)
18 throw Exception("opening interpreted file: !stream");
19
20 stream.exceptions(std::ios::badbit);
21
22 Multiplexer multiplexer{db, journal};
23 Interpreter interpreter(db, multiplexer, Record_Id::null);
24 interpreter.set_echo(false);
25 interpreter.set_rethrow(true);
26 {
27 std::ofstream null_stream;
28 interpreter.main_loop(stream, null_stream);
29 }
31
32 if (readonly)
34 }
35
36 ////////////////////////////////////////////////////////////////////////////
38 ////////////////////////////////////////////////////////////////////////////
39}
void main_loop(std::istream &in, std::ostream &out)
void set_rethrow(bool new_rethrow)
Readonly_Interpreted_File(std::istream &stream, bool readonly)
static const Record_Id null
Definition index_types.h:44
Definition Blob.h:7