Joedb
10.2.1
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
src
joedb
ui
main_wrapper.cpp
Go to the documentation of this file.
1
#include "
joedb/ui/main_wrapper.h
"
2
3
#include <iostream>
4
5
namespace
joedb
6
{
7
/// Process command-line arguments and catch exceptions from main
8
///
9
/// This function is particularly necessary in Windows, because no
10
/// exception information is printed when main throws.
11
///
12
/// @ingroup ui
13
int
main_wrapper
14
(
15
int
(*
main
)(
Arguments
&),
int
argc,
char
**argv
16
)
17
{
18
try
19
{
20
Arguments
arguments(argc, argv);
21
return
main
(arguments);
22
}
23
catch
(
const
std::exception &e)
24
{
25
std::cerr <<
"Exception caught: "
<< e.what() <<
'\n'
;
26
return
1;
27
}
28
}
29
}
joedb::Arguments
Class for conveniently parsing command-line arguments.
Definition
Arguments.h:19
main
int main()
Definition
concurrency_tutorial.cpp:6
joedb::main_wrapper
int main_wrapper(int(*main)(Arguments &), int argc, char **argv)
Process command-line arguments and catch exceptions from main.
Definition
main_wrapper.cpp:14
main_wrapper.h
joedb
Definition
Server.cpp:11
Generated by
1.9.8