]> git.stg.codes - stg.git/blobdiff - projects/stargazer/settings_impl.cpp
New fee charge algo added
[stg.git] / projects / stargazer / settings_impl.cpp
index d197efc40c32877bf1852982b2f34a8df7a15d93..16a2ac47130f1497fdb47ec1ee33e923989c5e42 100644 (file)
@@ -138,71 +138,6 @@ SETTINGS_IMPL::SETTINGS_IMPL(const SETTINGS_IMPL & rval)
 {
 }
 //-----------------------------------------------------------------------------
-int SETTINGS_IMPL::ParseYesNo(const string & value, bool * val)
-{
-if (0 == strcasecmp(value.c_str(), "yes"))
-    {
-    *val = true;
-    return 0;
-    }
-if (0 == strcasecmp(value.c_str(), "no"))
-    {
-    *val = false;
-    return 0;
-    }
-
-strError = "Incorrect value \'" + value + "\'.";
-return -1;
-}
-//-----------------------------------------------------------------------------
-int SETTINGS_IMPL::ParseInt(const string & value, int * val)
-{
-if (str2x<int>(value, *val))
-    {
-    strError = "Cannot convert \'" + value + "\' to integer.";
-    return -1;
-    }
-return 0;
-}
-//-----------------------------------------------------------------------------
-int SETTINGS_IMPL::ParseUnsigned(const string & value, unsigned * val)
-{
-if (str2x<unsigned>(value, *val))
-    {
-    strError = "Cannot convert \'" + value + "\' to unsigned integer.";
-    return -1;
-    }
-return 0;
-}
-//-----------------------------------------------------------------------------
-int SETTINGS_IMPL::ParseIntInRange(const string & value, int min, int max, int * val)
-{
-if (ParseInt(value, val) != 0)
-    return -1;
-
-if (*val < min || *val > max)
-    {
-    strError = "Value \'" + value + "\' out of range.";
-    return -1;
-    }
-
-return 0;
-}
-//-----------------------------------------------------------------------------
-int SETTINGS_IMPL::ParseUnsignedInRange(const string & value, unsigned min, unsigned max, unsigned * val)
-{
-if (ParseUnsigned(value, val) != 0)
-    return -1;
-
-if (*val < min || *val > max)
-    {
-    strError = "Value \'" + value + "\' out of range.";
-    return -1;
-    }
-
-return 0;
-}
-//-----------------------------------------------------------------------------
 int SETTINGS_IMPL::ParseModuleSettings(const DOTCONFDocumentNode * node, vector<PARAM_VALUE> * params)
 {
 const DOTCONFDocumentNode * childNode;
@@ -440,7 +375,7 @@ while (node)
 
     if (strcasecmp(node->getName(), "FeeChargeType") == 0)
         {
-        if (ParseUnsignedInRange(node->getValue(0), 0, 2, &feeChargeType) != 0)
+        if (ParseUnsignedInRange(node->getValue(0), 0, 3, &feeChargeType) != 0)
             {
             strError = "Incorrect FeeChargeType value: \'" + string(node->getValue(0)) + "\'";
             return -1;