I like (and use) this lib.
I'd prefer the overwrite of the config file to be the default, as usually one just reads, updates, and saves settings.
inline static void write(..., const bool overwrite=true) {...
i
f (!overwrite) {
if (struct stat buf; stat(filepath.c_str(), &buf) == 0) {
throw std::runtime_error("file: " + filepath + " already exist.");
}
} else {
system(("rm -rf " + iniFileName).c_str());
}
I like (and use) this lib.
I'd prefer the overwrite of the config file to be the default, as usually one just reads, updates, and saves settings.
inline static void write(..., const bool overwrite=true) {...
i
f (!overwrite) {
if (struct stat buf; stat(filepath.c_str(), &buf) == 0) {
throw std::runtime_error("file: " + filepath + " already exist.");
}
} else {
system(("rm -rf " + iniFileName).c_str());
}