Menu

[r331]: / cms / trunk / main.cpp  Maximize  Restore  History

Download this file

50 lines (43 with data), 1.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include <iostream>
#include <memory>
#include "blog.h"
#include <cppcms/thread_pool.h>
#include <cppcms/global_config.h>
#include <cppcms/url.h>
#include <dbi/dbixx.h>
#include <tmpl/transtext.h>
using namespace std;
using namespace cppcms;
tmpl::template_data global_template;
transtext::trans_gnu gnugt;
transtext::trans_factory tr;
int main(int argc,char **argv)
{
try{
global_config.load(argc,argv);
global_template.load(global_config.sval("templates.file"));
if(global_config.lval("locale.gnugettext",0)==1) {
gnugt.load(global_config.sval("locale.default","").c_str(),
"cppblog",
global_config.sval("locale.dir","./locale").c_str());
}
else {
tr.load(global_config.sval("locale.supported","en").c_str(),
"cppblog",
global_config.sval("locale.dir","./locale").c_str());
}
run_application<Blog>(argc,argv);
cout<<"Exiting\n";
}
catch(cppcms_error &s) {
cerr<<s.what()<<endl;
return 1;
}
catch(dbixx::dbixx_error &e) {
cerr<<"dbi:"<<e.what()<<endl;
}
catch(std::exception &e) {
cerr<<e.what()<<endl;
}
return 0;
}
MongoDB Logo MongoDB