Joedb 10.2.1
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
File_Client_h.cpp
Go to the documentation of this file.
3
4namespace joedb::generator
5{
6 ////////////////////////////////////////////////////////////////////////////
8 ////////////////////////////////////////////////////////////////////////////
9 (
10 const Compiler_Options &options
11 ):
12 Generator(".", "File_Client.h", options)
13 {
14 }
15
16 ////////////////////////////////////////////////////////////////////////////
18 ////////////////////////////////////////////////////////////////////////////
19 {
21
22 out << R"RRR(
23#include "Client.h"
24#include "joedb/journal/File.h"
25
26)RRR";
27
29
30 out << R"RRR(
31 /// Shortcut to directly build a @ref Client from a file name
32 class File_Client: private joedb::File, public Client
33 {
34 public:
35 File_Client(const char *file_name):
36 joedb::File
37 (
38 file_name,
39 joedb::File::lockable
40 ? joedb::Open_Mode::shared_write
41 : joedb::Open_Mode::write_existing_or_create_new
42 ),
43 Client(*this, joedb::Connection::dummy)
44 {
45 }
46
47 File_Client(const std::string &file_name):
48 File_Client(file_name.c_str())
49 {
50 }
51 };
52)RRR";
53
56 }
57}
const std::vector< std::string > & get_name_space() const
File_Client_h(const Compiler_Options &options)
const Compiler_Options & options
Definition Generator.h:13
void namespace_open(std::ostream &out, const std::vector< std::string > &n)
void namespace_close(std::ostream &out, const std::vector< std::string > &n)
void namespace_include_guard_open(std::ostream &out, const char *name, const std::vector< std::string > &n)
void namespace_include_guard_close(std::ostream &out)
One code generator for each of the file generated by joedbc.
Definition Client_h.cpp:5