INTRODUCTION Overview Download and Install Quick Start Documentation Publications NONFRAMEWORK CODE Driver Interfaces Drivers Libraries Utilities FRAMEWORK CODE Interfaces Components Libraries Utilities Full Software Listings DEVELOPER Tutorials Examples Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
propertydb.h00001 #ifndef PROPSERVER_PROPERTYDB_H 00002 #define PROPSERVER_PROPERTYDB_H 00003 00004 #include <string> 00005 #include <map> 00006 00007 namespace propserver { 00008 00009 // 00010 // @brief Property Database 00011 // 00012 // @author Alex Brooks 00013 // 00014 class PropertyDb 00015 { 00016 00017 public: 00018 00019 PropertyDb(); 00020 ~PropertyDb(); 00021 00022 // Overwrites any existing properties of the same name. 00023 void addProperties( const std::map<std::string,std::string> &newProperties ); 00024 const std::map<std::string,std::string> &properties() const { return properties_; } 00025 00026 void writePropertiesToFile( const std::string &filename ); 00027 // Overwrites any existing properties of the same name. 00028 void readPropertiesFromFile( const std::string &filename ); 00029 00030 private: 00031 00032 std::map<std::string,std::string> properties_; 00033 00034 }; 00035 00036 std::string toString( const std::map<std::string,std::string> &properties ); 00037 void writeToFile( const std::string &filename, const std::map<std::string,std::string> &properties ); 00038 std::map<std::string,std::string> readFromFile( const std::string &filename ); 00039 00040 } 00041 00042 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)