Joedb
9.5.0
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
src
joedb
journal
Readonly_Interpreted_File.cpp
Go to the documentation of this file.
1
#include "
joedb/journal/Readonly_Interpreted_File.h
"
2
#include "
joedb/Multiplexer.h
"
3
#include "
joedb/ui/Interpreter.h
"
4
5
namespace
joedb
6
{
7
////////////////////////////////////////////////////////////////////////////
8
Readonly_Interpreted_File::Readonly_Interpreted_File
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
}
29
journal
.
soft_checkpoint
();
30
31
if
(readonly)
32
make_readonly
();
33
}
34
35
////////////////////////////////////////////////////////////////////////////
36
Readonly_Interpreted_File::~Readonly_Interpreted_File
() =
default
;
37
////////////////////////////////////////////////////////////////////////////
38
}
Interpreter.h
Readonly_Interpreted_File.h
joedb::Buffered_File::make_readonly
void make_readonly()
Definition
Buffered_File.h:78
joedb::Command_Interpreter::main_loop
void main_loop(std::istream &in, std::ostream &out)
Definition
Command_Interpreter.cpp:137
joedb::Command_Interpreter::set_echo
void set_echo(bool new_echo)
Definition
Command_Interpreter.h:47
joedb::Command_Interpreter::set_rethrow
void set_rethrow(bool new_rethrow)
Definition
Command_Interpreter.h:48
joedb::Exception
Definition
Exception.h:10
joedb::Interpreter
Definition
Interpreter.h:54
joedb::Multiplexer
Definition
Multiplexer.h:14
joedb::Readonly_Interpreted_File::Readonly_Interpreted_File
Readonly_Interpreted_File(std::istream &stream, bool readonly)
Definition
Readonly_Interpreted_File.cpp:10
joedb::Readonly_Interpreted_File::~Readonly_Interpreted_File
~Readonly_Interpreted_File()
joedb::Readonly_Interpreted_File::journal
Writable_Journal journal
Definition
Readonly_Interpreted_File.h:16
joedb::Readonly_Interpreted_File::db
Database db
Definition
Readonly_Interpreted_File.h:17
joedb::Writable::soft_checkpoint
void soft_checkpoint()
Definition
Writable.h:21
joedb
Definition
Blob.h:7
Multiplexer.h
Generated by
1.9.8