]> git.stg.codes - stg.git/blobdiff - include/stg/user_property.h
Add verification exist parametr
[stg.git] / include / stg / user_property.h
index aee32e3e34a6bedb0949aeaac7e3c9344c7cb717..7d68e73410fc502ecf5ef8831dd4d7c090b474ba 100644 (file)
@@ -138,6 +138,7 @@ public:
     void SetProperties(const USER_PROPERTIES & p) { stat = p.stat; conf = p.conf; }
 
     std::string GetPropertyValue(const std::string & name) const;
+    bool                  Exists(const std::string & name) const;
 
     USER_PROPERTY_LOGGED<double>            cash;
     USER_PROPERTY_LOGGED<DIR_TRAFF>         up;
@@ -395,6 +396,13 @@ if (it == properties.end())
     return "";
 return it->second->ToString();
 }
+//-----------------------------------------------------------------------------
+inline
+bool USER_PROPERTIES::Exists(const std::string & name) const
+{
+if (properties.find(name)!=properties.end()) return true;
+return false;
+}
 //-------------------------------------------------------------------------
 //-------------------------------------------------------------------------
 //-------------------------------------------------------------------------