CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Properties.cc
Go to the documentation of this file.
2 
3 ora::Properties::Properties():m_properties(),m_flags(){
4 }
5 
7 }
8 
9 bool ora::Properties::setProperty(const std::string& propertyName, const std::string& propertyValue){
10  bool ret = false;
11  if(m_properties.find(propertyName)!=m_properties.end()){
12  ret = true;
13  m_properties.erase(propertyName);
14  }
15  m_properties.insert(std::make_pair(propertyName,propertyValue));
16  return ret;
17 }
18 
19 void ora::Properties::setFlag(const std::string& flagName){
20  m_flags.insert(flagName);
21 }
22 
23 bool ora::Properties::hasProperty(const std::string& propertyName) const {
24  return (m_properties.find(propertyName)!=m_properties.end());
25 }
26 
27 std::string ora::Properties::getProperty(const std::string& propertyName) const {
28  std::string ret("");
29  std::map<std::string,std::string>::const_iterator iP = m_properties.find(propertyName);
30  if(iP!=m_properties.end()){
31  ret = iP->second;
32  }
33  return ret;
34 }
35 
36 bool ora::Properties::getFlag(const std::string& flagName) const {
37  bool ret = false;
38  if(m_flags.find(flagName)!=m_flags.end()){
39  ret = true;
40  }
41  return ret;
42 }
43 
44 bool ora::Properties::removeProperty(const std::string& propertyName){
45  bool ret = false;
46  if(m_properties.find(propertyName)!=m_properties.end()){
47  ret = true;
48  m_properties.erase(propertyName);
49  }
50  return ret;
51 }
52 
53 bool ora::Properties::removeFlag(const std::string& flagName){
54  bool ret = false;
55  if(m_flags.find(flagName)!=m_flags.end()){
56  ret = true;
57  m_flags.erase(flagName);
58  }
59  return ret;
60 }
61 
62 
bool hasProperty(const std::string &propertyName) const
Definition: Properties.cc:23
bool getFlag(const std::string &flagName) const
Definition: Properties.cc:36
bool removeProperty(const std::string &propertyName)
Definition: Properties.cc:44
bool setProperty(const std::string &propertyName, const std::string &propertyValue)
Definition: Properties.cc:9
virtual ~Properties()
Definition: Properties.cc:6
std::string getProperty(const std::string &propertyName) const
Definition: Properties.cc:27
bool removeFlag(const std::string &flagName)
Definition: Properties.cc:53
void setFlag(const std::string &flagName)
Definition: Properties.cc:19