Go to the documentation of this file.00001 #ifndef PROPERTIES_H
00002 #define PROPERTIES_H
00003
00004 #include <map>
00005 #include <string>
00006 #include <vector>
00007 #include <memory>
00008 #include <stdexcept>
00009
00010 namespace acsalarm
00011 {
00012 typedef std::map< std::string, std::string >::value_type PropertyMapEntryType;
00013
00014
00015
00016
00017 class Properties
00018 {
00019 private:
00020
00021 std::map<std::string, std::string> propertiesMap;
00022
00023 public:
00024
00025
00026 Properties();
00027 Properties(const Properties &);
00028
00029
00030 virtual ~Properties();
00031
00032
00033 Properties & operator=(const Properties & rhs);
00034
00035
00036 bool operator==(const Properties &rhs) ;
00037
00038
00039 bool operator!=(const Properties &rhs) ;
00040
00048 std::string getProperty(std::string key) const;
00049
00050
00051
00052
00053 std::auto_ptr<std::vector<std::string> > propertyNames();
00054
00061 void setProperty(std::string key, std::string value) throw(std::invalid_argument);
00062
00063
00064
00065
00066
00067 std::string toXML(int amountToIndent = 6);
00068
00072 unsigned int getSize() const { return propertiesMap.size(); }
00073 };
00074 }
00075 #endif