CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/CondCore/ORA/src/Properties.cc

Go to the documentation of this file.
00001 #include "CondCore/ORA/interface/Properties.h"
00002 
00003 ora::Properties::Properties():m_properties(),m_flags(){
00004 }
00005 
00006 ora::Properties::~Properties(){
00007 }
00008 
00009 bool ora::Properties::setProperty(const std::string& propertyName, const std::string& propertyValue){
00010   bool ret = false;
00011   if(m_properties.find(propertyName)!=m_properties.end()){
00012     ret = true;
00013     m_properties.erase(propertyName);
00014   }
00015   m_properties.insert(std::make_pair(propertyName,propertyValue));
00016   return ret;
00017 }
00018 
00019 void ora::Properties::setFlag(const std::string& flagName){
00020   m_flags.insert(flagName);
00021 }
00022 
00023 bool ora::Properties::hasProperty(const std::string& propertyName) const {
00024   return (m_properties.find(propertyName)!=m_properties.end());
00025 }
00026 
00027 std::string ora::Properties::getProperty(const std::string& propertyName) const {
00028   std::string ret("");
00029   std::map<std::string,std::string>::const_iterator iP = m_properties.find(propertyName);
00030   if(iP!=m_properties.end()){
00031     ret = iP->second;
00032   }
00033   return ret;
00034 }
00035 
00036 bool ora::Properties::getFlag(const std::string& flagName) const {
00037   bool ret = false;
00038   if(m_flags.find(flagName)!=m_flags.end()){
00039     ret = true;
00040   }
00041   return ret;
00042 }
00043 
00044 bool ora::Properties::removeProperty(const std::string& propertyName){
00045   bool ret = false;
00046   if(m_properties.find(propertyName)!=m_properties.end()){
00047     ret = true;
00048     m_properties.erase(propertyName);
00049   }
00050   return ret;
00051 }
00052 
00053 bool ora::Properties::removeFlag(const std::string& flagName){
00054   bool ret = false;
00055   if(m_flags.find(flagName)!=m_flags.end()){
00056     ret = true;
00057     m_flags.erase(flagName);
00058   }
00059   return ret;
00060 }
00061 
00062