]> git.stg.codes - stg.git/commitdiff
Correcting case insensitive search
authorNaffanya <naffanya@naffanya.(none)>
Thu, 30 Jan 2014 19:57:13 +0000 (21:57 +0200)
committerNaffanya <naffanya@naffanya.(none)>
Thu, 30 Jan 2014 19:57:13 +0000 (21:57 +0200)
include/stg/user_property.h
projects/stargazer/user_impl.cpp

index 398c457914894ea083d8f31e3cde6756985f569d..f2421213bc6efbdc3dc3ccacc62dccd2588413d3 100644 (file)
@@ -392,7 +392,7 @@ else
 inline
 std::string USER_PROPERTIES::GetPropertyValue(const std::string & name) const
 {
 inline
 std::string USER_PROPERTIES::GetPropertyValue(const std::string & name) const
 {
-std::map<std::string, USER_PROPERTY_BASE*>::const_iterator it = properties.find(name);
+std::map<std::string, USER_PROPERTY_BASE*>::const_iterator it = properties.find(ToLower(name));
 if (it == properties.end())
     return "";
 return it->second->ToString();
 if (it == properties.end())
     return "";
 return it->second->ToString();
@@ -401,7 +401,7 @@ return it->second->ToString();
 inline
 bool USER_PROPERTIES::Exists(const std::string & name) const
 {
 inline
 bool USER_PROPERTIES::Exists(const std::string & name) const
 {
-return properties.find(name) != properties.end();
+return properties.find(ToLower(name)) != properties.end();
 }
 //-------------------------------------------------------------------------
 //-------------------------------------------------------------------------
 }
 //-------------------------------------------------------------------------
 //-------------------------------------------------------------------------
index 7f6ff352f7fb4677cd5947c0ebf9dbde4d12a20e..25bfe52604a1f28481e00dcca8586a9e86993095 100644 (file)
@@ -1511,15 +1511,15 @@ while (it != messages.end())
 //-----------------------------------------------------------------------------
 std::string USER_IMPL::GetParamValue(const std::string & name) const
 {
 //-----------------------------------------------------------------------------
 std::string USER_IMPL::GetParamValue(const std::string & name) const
 {
-    if (name == "id")
+    if (ToLower(name) == "id")
         {
         std::ostringstream stream;
         stream << id;
         return stream.str();
         }
         {
         std::ostringstream stream;
         stream << id;
         return stream.str();
         }
-    if (name == "login")       return login;
-    if (name == "currIP")      return currIP.ToString();
-    if (name == "enabledDirs") return GetEnabledDirs();
+    if (ToLower(name) == "login")       return login;
+    if (ToLower(name) == "currip")      return currIP.ToString();
+    if (ToLower(name) == "enableddirs") return GetEnabledDirs();
     if (property.Exists(name)) 
         return property.GetPropertyValue(name);
     else
     if (property.Exists(name)) 
         return property.GetPropertyValue(name);
     else