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

Diff of /smsdaemon/Common.cpp

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

revision 55 by torben, Wed Jun 11 14:25:08 2008 UTC revision 114 by torben, Sun Nov 2 20:14:20 2008 UTC
# Line 1  Line 1 
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>
# Line 7  Line 11 
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  {  {
# Line 17  Common* Common::instance() Line 24  Common* Common::instance()
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);
# Line 52  void Common::logMessage(string msg) Line 86  void Common::logMessage(string msg)
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;
# Line 87  void Common::loadConfig(int argc, char* Line 122  void Common::loadConfig(int argc, char*
122                  }                  }
123                  else                  else
124                  {                  {
125                          cout << VERSION;                          cout << "Unknown argument : " << current << endl << endl;
                         cout << "Unknown argument : " << current << endl;  
126                  }                  }
127          }          }
128    

Legend:
Removed from v.55  
changed lines
  Added in v.114

  ViewVC Help
Powered by ViewVC 1.1.20