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

Method GetInt

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

Source from the content-addressed store, hash-verified

62}
63
64int mitk::Preferences::GetInt(const std::string& key, int def) const
65{
66 auto value = this->FindValue(key);
67
68 if (!value.has_value())
69 return def;
70
71 try
72 {
73 return std::stoi(value.value());
74 }
75 catch (...)
76 {
77 mitkThrow() << "The property [\"" << key << "\": \"" << value.value() << "\"] does not represent a valid int value!";
78 }
79}
80
81void mitk::Preferences::PutInt(const std::string& key, int value)
82{

Callers 15

ApplyPreferencesMethod · 0.45
GetPreferencesFunction · 0.45
OnFetchBtnClickedMethod · 0.45
GetActiveLimitMethod · 0.45
GetLastPositiveLimitMethod · 0.45
GetOutputFormatMethod · 0.45
UpdateMethod · 0.45
ShowPerspectiveMethod · 0.45
UpdateMethod · 0.45
FillMethod · 0.45

Calls 2

FindValueMethod · 0.95
valueMethod · 0.45

Tested by 3

GetItemMethod · 0.36
OpenOtherMethod · 0.36
UpdateMethod · 0.36