| 98 | } |
| 99 | |
| 100 | float mitk::Preferences::GetFloat(const std::string& key, float def) const |
| 101 | { |
| 102 | auto value = this->FindValue(key); |
| 103 | |
| 104 | if (!value.has_value()) |
| 105 | return def; |
| 106 | |
| 107 | try |
| 108 | { |
| 109 | return std::stof(value.value()); |
| 110 | } |
| 111 | catch (...) |
| 112 | { |
| 113 | mitkThrow() << "The property [\"" << key << "\": \"" << value.value() << "\"] does not represent a valid float value!"; |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | void mitk::Preferences::PutFloat(const std::string& key, float value) |
| 118 | { |
no test coverage detected