]> git.stg.codes - stg.git/commitdiff
Correcting code
authorNaffanya <naffanya@naffanya.(none)>
Mon, 27 May 2013 16:52:49 +0000 (19:52 +0300)
committerNaffanya <naffanya@naffanya.(none)>
Mon, 27 May 2013 16:52:49 +0000 (19:52 +0300)
include/stg/settings.h
projects/stargazer/main.cpp
projects/stargazer/settings_impl.cpp
projects/stargazer/settings_impl.h

index 385439881a5f194b0f453775556f7d335065673a..170f71cada5dc1f3edfbe0c475830ebdcd1ec214 100644 (file)
 class SETTINGS {
 public:
     virtual ~SETTINGS() {}
 class SETTINGS {
 public:
     virtual ~SETTINGS() {}
-    virtual const            std::string & GetDirName(size_t num) const = 0;
-    virtual const            std::string & GetScriptsDir() const = 0;
-    virtual unsigned                       GetDetailStatWritePeriod() const = 0;
-    virtual unsigned                       GetStatWritePeriod() const = 0;
-    virtual unsigned                       GetDayFee() const = 0;
-    virtual bool                           GetFullFee() const = 0;
-    virtual unsigned                       GetDayResetTraff() const = 0;
-    virtual bool                           GetSpreadFee() const = 0;
-    virtual bool                           GetFreeMbAllowInet() const = 0;
-    virtual bool                           GetDayFeeIsLastDay() const = 0;
-    virtual bool                           GetWriteFreeMbTraffCost() const = 0;
-    virtual bool                           GetShowFeeInCash() const = 0;
-    virtual unsigned                       GetMessageTimeout() const = 0;
-    virtual unsigned                       GetFeeChargeType() const = 0;
-    virtual bool                           GetReconnectOnTariffChange() const = 0;
-    virtual const            std::string & GetMonitorDir() const = 0;
-    virtual bool                           GetMonitoring() const = 0;
+    virtual const std::string &              GetDirName(size_t num) const = 0;
+    virtual const std::string &              GetScriptsDir() const = 0;
+    virtual unsigned                         GetDetailStatWritePeriod() const = 0;
+    virtual unsigned                         GetStatWritePeriod() const = 0;
+    virtual unsigned                         GetDayFee() const = 0;
+    virtual bool                             GetFullFee() const = 0;
+    virtual unsigned                         GetDayResetTraff() const = 0;
+    virtual bool                             GetSpreadFee() const = 0;
+    virtual bool                             GetFreeMbAllowInet() const = 0;
+    virtual bool                             GetDayFeeIsLastDay() const = 0;
+    virtual bool                             GetWriteFreeMbTraffCost() const = 0;
+    virtual bool                             GetShowFeeInCash() const = 0;
+    virtual unsigned                         GetMessageTimeout() const = 0;
+    virtual unsigned                         GetFeeChargeType() const = 0;
+    virtual bool                             GetReconnectOnTariffChange() const = 0;
+    virtual const std::string &              GetMonitorDir() const = 0;
+    virtual bool                             GetMonitoring() const = 0;
     virtual const std::vector<std::string> & GetScriptParams() const = 0;
 };
 //-----------------------------------------------------------------------------
     virtual const std::vector<std::string> & GetScriptParams() const = 0;
 };
 //-----------------------------------------------------------------------------
index c7bfb4aaa1756ad4d1b3a2a0bc780e45a39b6e46..8d0f6d20a989a6747b02228e2fe97259c0f6edbc 100644 (file)
@@ -270,17 +270,16 @@ if (settings->ReadSettings())
     WriteServLog("ReadSettings error. %s", settings->GetStrError().c_str());
     exit(1);
     }
     WriteServLog("ReadSettings error. %s", settings->GetStrError().c_str());
     exit(1);
     }
-/*************************************************************************************************/
-//вывод scriptParams
+    /*************************************************************************************************/
     printfd(__FILE__, "--- Script params dump ---\n");
     std::vector<std::string>::const_iterator it(settings->GetScriptParams().begin());
     while (it != settings->GetScriptParams().end())
     printfd(__FILE__, "--- Script params dump ---\n");
     std::vector<std::string>::const_iterator it(settings->GetScriptParams().begin());
     while (it != settings->GetScriptParams().end())
-    {
+        {
         printfd(__FILE__, "%s\n", it->c_str());
         printfd(__FILE__, "%s\n", it->c_str());
-        it++;
-    }
+        ++it;
+        }
     printfd(__FILE__, "--- End dump ---\n"); 
     printfd(__FILE__, "--- End dump ---\n"); 
-/*************************************************************************************************/
+    /*************************************************************************************************/
     
 #ifndef NO_DAEMON
 std::string startFile(settings->GetConfDir() + START_FILE);
     
 #ifndef NO_DAEMON
 std::string startFile(settings->GetConfDir() + START_FILE);
index 8e4acceeb033b6f84c4cdfd744fe9225947ebd32..8511794cddc512a2be0bea12d0264ddca9a5df55 100644 (file)
@@ -458,15 +458,12 @@ while (node)
         }
 
         if (strcasecmp(node->getName(), "ScriptParams") == 0)
         }
 
         if (strcasecmp(node->getName(), "ScriptParams") == 0)
-        {
-            int i;
-            i=0;
-            while (node->getValue(i)!=NULL)
             {
             {
+            for (int i = 0; node->getValue(i) != NULL; ++i)
+                {
                 scriptParams.push_back(node->getValue(i));
                 scriptParams.push_back(node->getValue(i));
-                i++;
+                }
             }
             }
-        }
     node = node->getNextNode();
     }
 
     node = node->getNextNode();
     }
 
index 3bee15471d5db602108d07d75ee44a7853b6495f..42f3541d1b90b7e68cfcf831af415d6732d84ef2 100644 (file)
@@ -99,7 +99,7 @@ public:
     const std::vector<MODULE_SETTINGS> & GetModulesSettings() const
         { return modulesSettings; }
                 
     const std::vector<MODULE_SETTINGS> & GetModulesSettings() const
         { return modulesSettings; }
                 
-    const std::vector<std::string> & GetScriptParams() const {return scriptParams; }
+    const std::vector<std::string> & GetScriptParams() const { return scriptParams; }
 
 private:
 
 
 private: