Joedb
10.0.1
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
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
}
30
journal
.
soft_checkpoint
();
31
32
if
(readonly)
33
make_readonly
();
34
}
35
36
////////////////////////////////////////////////////////////////////////////
37
Readonly_Interpreted_File::~Readonly_Interpreted_File
() =
default
;
38
////////////////////////////////////////////////////////////////////////////
39
}
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:139
joedb::Command_Interpreter::set_echo
void set_echo(bool new_echo)
Definition
Command_Interpreter.h:49
joedb::Command_Interpreter::set_rethrow
void set_rethrow(bool new_rethrow)
Definition
Command_Interpreter.h:50
joedb::Exception
Definition
Exception.h:10
joedb::Interpreter
Definition
Interpreter.h:41
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:19
joedb::Readonly_Interpreted_File::db
Database db
Definition
Readonly_Interpreted_File.h:17
joedb::Record_Id::null
static const Record_Id null
Definition
index_types.h:44
joedb::Writable_Journal::soft_checkpoint
void soft_checkpoint() override
Definition
Writable_Journal.cpp:139
joedb
Definition
Blob.h:7
Multiplexer.h
Generated by
1.9.8