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

Diff of /smsdaemon/Common.cpp

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

revision 175 by torben, Wed Dec 10 22:02:28 2008 UTC revision 208 by torben, Sun Dec 21 18:41:08 2008 UTC
# Line 24  Common* Common::instance() Line 24  Common* Common::instance()
24    
25    
26  Common::Common()  Common::Common()
27          : _pluginManager(0), _taskManager(0)                  : _pluginManager(0), _taskManager(0)
28  {  {
29          _pluginManager = new PluginManager();          _pluginManager = new PluginManager();
30          _taskManager = new TaskManager();          _taskManager = new TaskManager();
# Line 32  Common::Common() Line 32  Common::Common()
32          _configFile = new ConfigFile();          _configFile = new ConfigFile();
33    
34          daemonized = false;          daemonized = false;
35            reloadConfig = false;
36  }  }
37    
38    
# Line 70  void Common::printUsage() Line 71  void Common::printUsage()
71          cout << "  --debug :        Run as normal (frontground) process," << endl;          cout << "  --debug :        Run as normal (frontground) process," << endl;
72          cout << "                   with all messages written to std out" << endl;          cout << "                   with all messages written to std out" << endl;
73          cout << "  --config <file>: Specify which config file to use " << endl;          cout << "  --config <file>: Specify which config file to use " << endl;
74          cout << "                   default" << configFilePath << endl;          cout << "                   default" << configFilePath << endl;
75          cout << "  --help :         Show this help screen" << endl;          cout << "  --help :         Show this help screen" << endl;
76    
77          exit(0);          exit(0);
# Line 84  void Common::loadConfig(int argc, char* Line 85  void Common::loadConfig(int argc, char*
85          for (int i = 1; i< argc; i++)          for (int i = 1; i< argc; i++)
86          {          {
87                  string current(argv[i]);                  string current(argv[i]);
88          if (current == "--daemon")                  if (current == "--daemon")
89                  {                  {
90                  isDaemon = true;                          isDaemon = true;
91                          isDebug = false;                          isDebug = false;
92                            
93                  }                  }
94                  else if (current == "--debug")                  else if (current == "--debug")
95                  {                  {
# Line 99  void Common::loadConfig(int argc, char* Line 100  void Common::loadConfig(int argc, char*
100                  {                  {
101                          i++;                          i++;
102                          if ( i<argc)                          if ( i<argc)
103                          {                          {
104                                  configFilePath = argv[i];                                  configFilePath = argv[i];
105                          }                          }
106                          else                          else
# Line 107  void Common::loadConfig(int argc, char* Line 108  void Common::loadConfig(int argc, char*
108                                  printUsage();                                  printUsage();
109                                  exit(1);                                  exit(1);
110                          }                          }
111                            
112                  }                  }
113                  else if (current == "-h" || current == "--help")                  else if (current == "-h" || current == "--help")
114                  {                  {
# Line 135  std::string Common::getStatusMessage() Line 136  std::string Common::getStatusMessage()
136          out << "Uptime " << diff << " seconds. ";          out << "Uptime " << diff << " seconds. ";
137          out << "Messages received:" << this->smsCounter.incomming << ". ";          out << "Messages received:" << this->smsCounter.incomming << ". ";
138          out << "Messages sent:" << this->smsCounter.outgoing << ".";          out << "Messages sent:" << this->smsCounter.outgoing << ".";
139            
140          return out.str();          return out.str();
141  }  }

Legend:
Removed from v.175  
changed lines
  Added in v.208

  ViewVC Help
Powered by ViewVC 1.1.20