]> git.stg.codes - stg.git/commitdiff
Add type REGISTRY in USER_PROPERTIES
authorNaffanya <naffanya@naffanya.(none)>
Sun, 2 Feb 2014 20:39:57 +0000 (22:39 +0200)
committerNaffanya <naffanya@naffanya.(none)>
Sun, 2 Feb 2014 20:39:57 +0000 (22:39 +0200)
include/stg/user_property.h
projects/stargazer/user_impl.cpp

index f2421213bc6efbdc3dc3ccacc62dccd2588413d3..da60ff1c7362f26772dcf50f0b848fc2b171bdd6 100644 (file)
@@ -121,11 +121,13 @@ class USER_PROPERTIES : private NONCOPYABLE {
  начале идет закрытая секция
  * */
 
+public:
+    typedef std::map<std::string, USER_PROPERTY_BASE *> REGISTRY;
 private:
     USER_STAT stat;
     USER_CONF conf;
 
-    std::map<std::string, USER_PROPERTY_BASE *> properties;
+    REGISTRY properties;
 public:
     USER_PROPERTIES(const std::string & sd);
 
@@ -280,7 +282,7 @@ USER_PROPERTY_LOGGED<varT>::USER_PROPERTY_LOGGED(varT & val,
                                                  bool isSt,
                                                  STG_LOGGER & logger,
                                                  const std::string & sd,
-                                                 std::map<std::string, USER_PROPERTY_BASE*> & properties)
+                                                 USER_PROPERTIES::REGISTRY & properties)
 
     : USER_PROPERTY<varT>(val),
       stgLogger(logger),
@@ -392,7 +394,7 @@ else
 inline
 std::string USER_PROPERTIES::GetPropertyValue(const std::string & name) const
 {
-std::map<std::string, USER_PROPERTY_BASE*>::const_iterator it = properties.find(ToLower(name));
+REGISTRY::const_iterator it = properties.find(ToLower(name));
 if (it == properties.end())
     return "";
 return it->second->ToString();
index f6dd38f11a48689ade90f19a7cfbe59266868c34..f15b182aaaea9fc756f447209e48b2e6dc19334a 100644 (file)
@@ -1521,7 +1521,7 @@ std::string USER_IMPL::GetParamValue(const std::string & name) const
     if (lowerName == "login")       return login;
     if (lowerName == "currip")      return currIP.ToString();
     if (lowerName == "enableddirs") return GetEnabledDirs();
-    if (property.Exists(lowerName)) 
+    if (property.Exists(lowerName))
         return property.GetPropertyValue(lowerName);
     else
         {