Joedb 10.4.3
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
Generator.h
Go to the documentation of this file.
1#ifndef joedb_generator_Generator_declared
2#define joedb_generator_Generator_declared
3
5
6#include <ostream>
7
8namespace joedb::generator
9{
10 /// @ingroup compiler
12 {
13 protected:
14 const std::string dir_name;
15 const std::string file_name;
17
18 bool db_has_values() const;
19
20 void write_initial_comment(std::ostream &out);
21 void write_type(std::ostream &out, Type type, bool return_type, bool setter_type);
22 void write_tuple_type(std::ostream &out, const Compiler_Options::Index &index, bool reference);
23
24 static const char *get_type_string(Type type);
25 static const char *get_cpp_type_string(Type type);
26 static const char *get_storage_type_string(Type type);
27
28 public:
30 (
31 std::string dir_name,
32 std::string file_name,
34 );
35
36 virtual void write(std::ostream &out) = 0;
37 void generate();
38
39 virtual ~Generator();
40 };
41}
42
43#endif
static const char * get_storage_type_string(Type type)
static const char * get_type_string(Type type)
static const char * get_cpp_type_string(Type type)
const std::string file_name
Definition Generator.h:15
const Compiler_Options & options
Definition Generator.h:16
const std::string dir_name
Definition Generator.h:14
virtual void write(std::ostream &out)=0
void write_tuple_type(std::ostream &out, const Compiler_Options::Index &index, bool reference)
Definition Generator.cpp:84
void write_initial_comment(std::ostream &out)
Definition Generator.cpp:23
void write_type(std::ostream &out, Type type, bool return_type, bool setter_type)
Definition Generator.cpp:42
One code generator for each of the file generated by joedbc.
Definition Client_h.cpp:5