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

Method Save

src/common/configfileparser.cpp:403–421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

401
402
403void File::Save(const fs::path &cfgfname)
404{
405 std::string fname = cfgfname.empty() ? config_filename : cfgfname;
406 if (fname.empty())
407 {
408 throw ConfigFileException("No configuration filename provided");
409 }
410
411 std::ofstream cfgfile(fname);
412 if (!empty())
413 {
414 cfgfile << Generate() << std::endl;
415 }
416 if (cfgfile.fail())
417 {
418 throw ConfigFileException(fname, "Error saving the configuration file");
419 }
420 cfgfile.close();
421}
422
423
424bool File::empty() const

Callers 5

save_propertyMethod · 0.80
save_config_fileFunction · 0.80
cmd_netcfg_serviceFunction · 0.80
manage_config_fileFunction · 0.80
TEST_FFunction · 0.80

Calls 2

ConfigFileExceptionClass · 0.85
emptyMethod · 0.45

Tested by 1

TEST_FFunction · 0.64