MCPcopy Create free account
hub / github.com/OpenVPN/openvpn3-linux / GetValue

Method GetValue

src/common/configfileparser.cpp:196–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194
195
196const std::string File::GetValue(const std::string &key)
197{
198 configure_mapping();
199
200 auto it = std::find_if(map.begin(),
201 map.end(),
202 [key](OptionMapEntry &e)
203 {
204 return key == e.option;
205 });
206 if (it == map.end())
207 {
208 throw OptionNotFound(key);
209 }
210 if (!it->present)
211 {
212 throw OptionNotPresent(key);
213 }
214
215 if (OptionValueType::Present == it->type)
216 {
217 return (it->present_value ? "true" : "false");
218 }
219 return it->value;
220}
221
222
223const int File::GetIntValue(const std::string &key)

Callers 5

client_serviceFunction · 0.45
backend_starterFunction · 0.45
config_managerFunction · 0.45
ImportConfigFileMethod · 0.45
RunCommandMethod · 0.45

Calls 2

OptionNotFoundClass · 0.85
OptionNotPresentClass · 0.85

Tested by

no test coverage detected