1 |
#include "common.h" |
#include "common.h" |
2 |
|
|
3 |
|
|
4 |
|
#include "version.h" |
5 |
|
|
6 |
#include <string> |
#include <string> |
7 |
#include <iostream> |
#include <iostream> |
8 |
#include <iomanip> |
#include <iomanip> |
10 |
#include <sstream> |
#include <sstream> |
11 |
#include <time.h> |
#include <time.h> |
12 |
|
|
13 |
|
#include "TaskManager.h" |
14 |
|
#include "PluginManager.h" |
15 |
|
|
16 |
using namespace std; |
using namespace std; |
17 |
char* Months[] = { "", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov","Dec"}; |
const char* Months[] = { "", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov","Dec"}; |
18 |
|
|
19 |
Common* Common::instance() |
Common* Common::instance() |
20 |
{ |
{ |
23 |
} |
} |
24 |
|
|
25 |
|
|
26 |
|
Common::Common() |
27 |
|
: _pluginManager(0), _taskManager(0) |
28 |
|
{ |
29 |
|
_pluginManager = new PluginManager(); |
30 |
|
_taskManager = new TaskManager(); |
31 |
|
} |
32 |
|
|
33 |
|
|
34 |
|
Common::~Common() |
35 |
|
{ |
36 |
|
if (_pluginManager) |
37 |
|
delete _pluginManager; |
38 |
|
|
39 |
|
if (_taskManager) |
40 |
|
delete _taskManager; |
41 |
|
} |
42 |
|
|
43 |
|
PluginManager* Common::GetPluginManager() |
44 |
|
{ |
45 |
|
return _pluginManager; |
46 |
|
} |
47 |
|
|
48 |
|
TaskManager* Common::GetTaskManager() |
49 |
|
{ |
50 |
|
return _taskManager; |
51 |
|
} |
52 |
|
|
53 |
void Common::logMessage(string msg) |
void Common::logMessage(string msg) |
54 |
{ |
{ |
55 |
time_t t = time(0); |
time_t t = time(0); |
85 |
void Common::printUsage() |
void Common::printUsage() |
86 |
{ |
{ |
87 |
cout << VERSION << endl; |
cout << VERSION << endl; |
88 |
|
cout << SVNVERSION << endl << endl; |
89 |
cout << "Usage --daemon|--debug [arguments]" << endl; |
cout << "Usage --daemon|--debug [arguments]" << endl; |
90 |
cout << "Commandline arguments :" << endl; |
cout << "Commandline arguments :" << endl; |
91 |
cout << " --daemon : Run in daemon (background) mode" << endl; |
cout << " --daemon : Run in daemon (background) mode" << endl; |
121 |
} |
} |
122 |
else |
else |
123 |
{ |
{ |
124 |
cout << VERSION; |
cout << "Unknown argument : " << current << endl << endl; |
|
cout << "Unknown argument : " << current << endl; |
|
125 |
} |
} |
126 |
} |
} |
127 |
|
|