Joedb 10.0.1
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
File_Database.h
Go to the documentation of this file.
1/////////////////////////////////////////////////////////////////////////////
2//
3// This code was automatically generated by the joedb compiler
4// https://www.joedb.org/
5//
6// Path to compiler: /home/rcoulom/repos/joedb/compcmake/gcc_debug/joedbc
7// Version: 10.0.1
8// joedbc compilation time: Jun 13 2025 15:26:57
9// Generation of this file: 2025-06-13 13:27:16 GMT
10//
11/////////////////////////////////////////////////////////////////////////////
12#ifndef tutorial_File_Database_declared
13#define tutorial_File_Database_declared
14
15#include "Writable_Database.h"
16#include "joedb/journal/File.h"
17
18namespace tutorial
19{
20 namespace detail
21 {
22 class File_Database_Data
23 {
24 protected:
25 joedb::File file;
26
27 File_Database_Data(const char *file_name, joedb::Open_Mode mode):
28 file(file_name, mode)
29 {
30 }
31 };
32 }
33
34 /// Shortcut to directly build a @ref Writable_Database from a file name
36 protected detail::File_Database_Data,
38 {
39 public:
41 (
42 const char *file_name,
45 ):
46 File_Database_Data(file_name, mode),
47 Writable_Database(file, recovery)
48 {
49 }
50
52 (
53 const std::string &file_name,
56 ):
57 File_Database(file_name.c_str(), mode, recovery)
58 {
59 }
60 };
61}
62
63#endif
Shortcut to directly build a Writable_Database from a file name.
File_Database(const std::string &file_name, joedb::Open_Mode mode=joedb::Open_Mode::write_existing_or_create_new, joedb::Recovery recovery=joedb::Recovery::none)
File_Database(const char *file_name, joedb::Open_Mode mode=joedb::Open_Mode::write_existing_or_create_new, joedb::Recovery recovery=joedb::Recovery::none)
A Database that contains a joedb::Writable_Journal and keeps them in sync.
Open_Mode
Definition Open_Mode.h:8
@ write_existing_or_create_new
either write_existing or create_new depending on whether the file exists. Racy in Posix,...
@ none
default: fail if file size > checkpoint
JOEDB_FILE File
Definition File.h:25
Automatically generated by joedbc.
Definition Client.h:19