#include #include "Properties.h" namespace cppproperties { Properties::Properties() { } Properties::~Properties() { } std::string Properties::GetProperty(const std::string& key) const { if (properties.find(key) == properties.end()) { throw PropertyNotFoundException(key + " does not exist"); } return properties.at(key); } std::string Properties::GetProperty(const std::string& key, const std::string& defaultValue) const { if (key.compare("fpga.correctColor.BOffset") == 0) printf("Get Config File Size (path: /usr/local/huago/ ��properties�� ) = %d \r\n",properties.size()); if (properties.find(key) == properties.end()) { return defaultValue; } return properties.at(key); } std::vector Properties::GetPropertyNames() const { return keys; } //�������ļ�����д��map void Properties::AddProperty(const std::string& key, const std::string& value) { if (properties.find(key) == properties.end()) { keys.push_back(key); } properties[key] = value; } void Properties::RemoveProperty(const std::string& key) { if (properties.find(key) == properties.end()) { throw PropertyNotFoundException(key + " does not exist"); } keys.erase(std::remove(keys.begin(), keys.end(), key), keys.end()); properties.erase(key); } } /* namespace cppproperties */