/[projects]/smsdaemon/Common.cpp
ViewVC logotype

Diff of /smsdaemon/Common.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 36 by torben, Tue Jun 10 15:34:19 2008 UTC revision 109 by torben, Sun Aug 24 17:57:04 2008 UTC
# Line 1  Line 1 
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>
# Line 7  Line 10 
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  {  {
# Line 17  Common* Common::instance() Line 23  Common* Common::instance()
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);
# Line 52  void Common::logMessage(string msg) Line 85  void Common::logMessage(string msg)
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;
# Line 87  void Common::loadConfig(int argc, char* Line 121  void Common::loadConfig(int argc, char*
121                  }                  }
122                  else                  else
123                  {                  {
124                          cout << VERSION;                          cout << "Unknown argument : " << current << endl << endl;
                         cout << "Unknown argument : " << current << endl;  
125                  }                  }
126          }          }
127    

Legend:
Removed from v.36  
changed lines
  Added in v.109

  ViewVC Help
Powered by ViewVC 1.1.20