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