Joedb 10.2.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 void write_index_type(std::ostream &out, const Compiler_Options::Index &index);
24
25 static const char *get_type_string(Type type);
26 static const char *get_cpp_type_string(Type type);
27 static const char *get_storage_type_string(Type type);
28
29 public:
31 (
32 std::string dir_name,
33 std::string file_name,
35 );
36
37 virtual void write(std::ostream &out) = 0;
38 void generate();
39
40 virtual ~Generator();
41 };
42}
43
44#endif
static const char * get_storage_type_string(Type type)
static const char * get_type_string(Type type)
void write_index_type(std::ostream &out, const Compiler_Options::Index &index)
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:74
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