Joedb
9.5.0
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
src
joedb
ui
Client_Parser.h
Go to the documentation of this file.
1
#ifndef joedb_Client_Parser_declared
2
#define joedb_Client_Parser_declared
3
4
#include "
joedb/ui/File_Parser.h
"
5
#include "
joedb/ui/Connection_Parser.h
"
6
#include "
joedb/concurrency/Client.h
"
7
8
namespace
joedb
9
{
10
//#define PERSISTENCE_TEST
11
/// @ingroup ui
12
class
Client_Parser
13
{
14
public
:
15
enum class
DB_Type
16
{
17
none
,
18
interpreted
,
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
:
55
Client_Parser
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
Connection_Parser.h
File_Parser.h
joedb::Client_Parser
Definition
Client_Parser.h:13
joedb::Client_Parser::Client_Parser
Client_Parser(Open_Mode default_open_mode, DB_Type default_db_type)
Definition
Client_Parser.cpp:102
joedb::Client_Parser::DB_Type
DB_Type
Definition
Client_Parser.h:16
joedb::Client_Parser::DB_Type::interpreted
@ interpreted
joedb::Client_Parser::DB_Type::none
@ none
joedb::Client_Parser::DB_Type::sql
@ sql
joedb::Client_Parser::DB_Type::dump
@ dump
joedb::Client_Parser::parse
Client & parse(int argc, const char *const *argv)
Definition
Client_Parser.cpp:148
joedb::Client_Parser::has_file
bool has_file() const
Definition
Client_Parser.h:62
joedb::Client_Parser::print_help
void print_help(std::ostream &out) const
Definition
Client_Parser.cpp:113
joedb::Content_Check
Content_Check
Definition
Connection.h:19
joedb::Content_Check::quick
@ quick
joedb::Open_Mode
Open_Mode
Definition
Open_Mode.h:8
joedb
Definition
Blob.h:7
Client.h
Generated by
1.9.8