Joedb 10.2.1
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
print_table_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(".", "print_table.h", options)
13 {
14 }
15
16 ////////////////////////////////////////////////////////////////////////////
18 ////////////////////////////////////////////////////////////////////////////
19 {
21
22 out << R"RRR(
23#include "Readable.h"
24#include "joedb/ui/Readable_Command_Processor.h"
25
26)RRR";
27
29
30 for (const auto &[tid, tname]: options.get_db().get_tables())
31 {
32 out << R"RRR(
33 inline void print_)RRR" << tname << R"RRR(_table
34 (
35 std::ostream &out,
36 const Database &db,
37 size_t max_column_width = 0,
38 Record_Id start = Record_Id::null,
39 size_t length = 0
40 )
41 {
42 Readable readable(db);
43 joedb::Readable_Command_Processor processor(readable);
44 processor.print_table
45 (
46 out,
47 )RRR" << tname << R"RRR(_table::id,
48 max_column_width,
49 start,
50 length
51 );
52 }
53)RRR";
54 }
55
58 }
59}
const std::vector< std::string > & get_name_space() const
const Database & get_db() const
const std::map< Table_Id, std::string > & get_tables() const override
const Compiler_Options & options
Definition Generator.h:13
print_table_h(const Compiler_Options &options)
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