Joedb 9.5.0
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
Client_Parser.h
Go to the documentation of this file.
1#ifndef joedb_Client_Parser_declared
2#define joedb_Client_Parser_declared
3
7
8namespace joedb
9{
10//#define PERSISTENCE_TEST
11 /// @ingroup ui
13 {
14 public:
15 enum class DB_Type
16 {
17 none,
19 dump,
20 sql,
21#ifdef PERSISTENCE_TEST
22 joedb
23#endif
24 };
25
26 private:
27 static constexpr const char *check_string[] =
28 {
29 "none",
30 "quick",
31 "full"
32 };
33
34 static constexpr const char *db_string[] =
35 {
36 "none",
37 "interpreted",
38 "dump",
39 "sql",
40#ifdef PERSISTENCE_TEST
41 "joedb"
42#endif
43 };
44
45 File_Parser file_parser;
46 Connection_Parser connection_parser;
47
48 const Open_Mode default_open_mode;
49 const DB_Type default_db_type;
50 static constexpr Content_Check default_content_check = Content_Check::quick;
51
52 std::unique_ptr<Client> client;
53
54 public:
56 (
57 Open_Mode default_open_mode,
58 DB_Type default_db_type
59 );
60
61 Client &parse(int argc, const char * const * argv);
62 bool has_file() const {return file_parser.get_file() != nullptr;}
63
64 void print_help(std::ostream &out) const;
65 };
66}
67
68#endif
Client_Parser(Open_Mode default_open_mode, DB_Type default_db_type)
Client & parse(int argc, const char *const *argv)
bool has_file() const
void print_help(std::ostream &out) const
Content_Check
Definition Connection.h:19
Open_Mode
Definition Open_Mode.h:8
Definition Blob.h:7