From: Mikko Rasa Date: Mon, 19 Dec 2022 18:04:40 +0000 (+0200) Subject: Use DataFile::Writer to write package configuration files X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=4c8aaaab1c38ecb8083863592ed70858ce16e028;p=builder.git Use DataFile::Writer to write package configuration files --- diff --git a/source/config.cpp b/source/config.cpp index 67f932f..4e57fdf 100644 --- a/source/config.cpp +++ b/source/config.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -81,9 +82,10 @@ void Config::save() const package.get_builder().get_logger().log("files", format("Writing %s", fn)); IO::BufferedFile out(fn.str(), IO::M_WRITE); + DataFile::Writer writer(out); for(const auto &kvp: options) - IO::print(out, "option \"%s\" \"%s\";\n", kvp.second.name, kvp.second.value); + writer.write((DataFile::Statement("option"), kvp.second.name, kvp.second.value)); changed = false; }