MCPcopy Create free account
hub / github.com/MITK/MITK / GetFloat

Method GetFloat

Modules/Core/src/IO/mitkPreferences.cpp:100–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100float 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
117void mitk::Preferences::PutFloat(const std::string& key, float value)
118{

Callers 2

GetOpacityFactorFunction · 0.45
GetOpacityFactorMethod · 0.45

Calls 2

FindValueMethod · 0.95
valueMethod · 0.45

Tested by

no test coverage detected