Joedb 9.1.4
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
joedb_client.cpp
Go to the documentation of this file.
6
7#include <iostream>
8
9namespace joedb
10{
11 ////////////////////////////////////////////////////////////////////////////
12 static int joedb_client(int argc, char **argv)
13 ////////////////////////////////////////////////////////////////////////////
14 {
15 const bool local = true;
16
17 const Open_Mode default_mode = File::lockable
20
21 Client_Parser client_parser(local, default_mode, true);
22
23 if (argc <= 1)
24 {
25 std::cerr << "usage: " << argv[0];
26 client_parser.print_help(std::cerr);
27 return 1;
28 }
29
30 Client &client = client_parser.parse(argc - 1, argv + 1);
31
32 Client_Command_Processor interpreter(client);
33 interpreter.set_prompt(true);
34 interpreter.main_loop(std::cin, std::cout);
35
36 return 0;
37 }
38}
39
40/////////////////////////////////////////////////////////////////////////////
41int main(int argc, char **argv)
42/////////////////////////////////////////////////////////////////////////////
43{
44 joedb::main_exception_catcher(joedb::joedb_client, argc, argv);
45}
int main()
Open_Mode
Definition Open_Mode.h:8
@ shared_write
like write_existing_or_create_new, but does not lock the file, and does not fail if locked
@ write_existing_or_create_new
either write_existing or create_new depending on whether the file exists. Racy in Posix,...
int main_exception_catcher(int(*main)(int, char **), int argc, char **argv)
Catch exception from main.
Definition Blob.h:7