| 119 | } |
| 120 | |
| 121 | double ConfigurationParser::GetDouble(const std::string& key, double defaultValue) const |
| 122 | { |
| 123 | auto v = entries.find(key); |
| 124 | if (v == entries.end()) return defaultValue; |
| 125 | try |
| 126 | { |
| 127 | return stod(v->second); |
| 128 | } catch (const exception&) |
| 129 | { |
| 130 | throw_with_nested(Exception("�������á�" + key + "��ֵת��Ϊdouble��")); |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | bool ConfigurationParser::GetBool(const std::string& key, bool defaultValue) const |
| 135 | { |