libzypp 17.31.23
|
Functions | |
std::map< std::string, std::string > | read (const Pathname &_path) |
Read sysconfig file path_r and return (key,valye) pairs. | |
bool | write (const Pathname &path_r, const std::string &key_r, const std::string &val_r, const std::string &newcomment_r=std::string()) |
Add or change a value in sysconfig file path_r. | |
bool | writeStringVal (const Pathname &path_r, const std::string &key_r, const std::string &val_r, const std::string &newcomment_r=std::string()) |
Convenience to add or change a string-value in sysconfig file path_r. | |
std::map< std::string, std::string > zypp::base::sysconfig::read | ( | const Pathname & | _path | ) |
Read sysconfig file path_r and return (key,valye)
pairs.
Definition at line 34 of file sysconfig.cc.
bool zypp::base::sysconfig::write | ( | const Pathname & | path_r, |
const std::string & | key_r, | ||
const std::string & | val_r, | ||
const std::string & | newcomment_r = std::string() |
||
) |
Add or change a value in sysconfig file path_r.
If key_r already exists, only the val_r is changed accordingly.
In case key_r is not yet present in the file, a new entry may be created at the end of the file, using the lines in newcomment_r as comment block. If newcomment_r is not provided or empty, a new value is not created and false
is returned.
TRUE
if an entry was changed or created.Exception | if path_r can not be read or written. |
Definition at line 80 of file sysconfig.cc.
bool zypp::base::sysconfig::writeStringVal | ( | const Pathname & | path_r, |
const std::string & | key_r, | ||
const std::string & | val_r, | ||
const std::string & | newcomment_r = std::string() |
||
) |
Convenience to add or change a string-value in sysconfig file path_r.
val_r is expected to be a plain string value, so it is propery escaped and enclosed in double quotes before it is written to the sysconfig file path_r.
Definition at line 148 of file sysconfig.cc.