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

Diff of /smsdaemon/common.cpp

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

revision 145 by torben, Sun Nov 2 20:14:20 2008 UTC revision 146 by torben, Sun Dec 7 20:06:12 2008 UTC
# Line 13  Line 13 
13    
14  #include "TaskManager.h"  #include "TaskManager.h"
15  #include "PluginManager.h"  #include "PluginManager.h"
16    #include "ConfigFile.h"
17    
18  using namespace std;  using namespace std;
19  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"};
# Line 29  Common::Common() Line 30  Common::Common()
30  {  {
31          _pluginManager = new PluginManager();          _pluginManager = new PluginManager();
32          _taskManager = new TaskManager();          _taskManager = new TaskManager();
33            configFilePath = "/etc/smsdaemon.conf";
34            _configFile = new ConfigFile();
35  }  }
36    
37    
# Line 51  TaskManager* Common::GetTaskManager() Line 54  TaskManager* Common::GetTaskManager()
54          return _taskManager;          return _taskManager;
55  }  }
56    
57    ConfigFile* Common::GetConfigfile()
58    {
59            return _configFile;
60    }
61    
62  void Common::logMessage(string msg)  void Common::logMessage(string msg)
63  {        {      
64          time_t t = time(0);          time_t t = time(0);
# Line 89  void Common::printUsage() Line 97  void Common::printUsage()
97          cout << SVNVERSION << endl << endl;          cout << SVNVERSION << endl << endl;
98          cout << "Usage --daemon|--debug [arguments]" << endl;          cout << "Usage --daemon|--debug [arguments]" << endl;
99          cout << "Commandline arguments :" << endl;          cout << "Commandline arguments :" << endl;
100          cout << "  --daemon : Run in daemon (background) mode" << endl;          cout << "  --daemon :       Run in daemon (background) mode" << endl;
101          cout << "  --debug :  Run as normal (frontground) process," << endl;          cout << "  --debug :        Run as normal (frontground) process," << endl;
102          cout << "             with all messages written to std out" << endl;          cout << "                   with all messages written to std out" << endl;
103          cout << "  --help :    Show this help screen" << endl;          cout << "  --config <file>: Specify which config file to use " << endl;
104            cout << "                   default" << configFilePath << endl;
105            cout << "  --help :         Show this help screen" << endl;
106    
107          exit(0);          exit(0);
108  }  }
# Line 116  void Common::loadConfig(int argc, char* Line 126  void Common::loadConfig(int argc, char*
126                          isDaemon = false;                          isDaemon = false;
127                          isDebug = true;                          isDebug = true;
128                  }                  }
129                    else if (current == "--config")
130                    {
131                    }
132                  else if (current == "-h" || current == "--help")                  else if (current == "-h" || current == "--help")
133                  {                  {
134                          printUsage();                          printUsage();

Legend:
Removed from v.145  
changed lines
  Added in v.146

  ViewVC Help
Powered by ViewVC 1.1.20