From 2e2d1bd3b6c7776b77c33b94f30ead89367a71e6 Mon Sep 17 00:00:00 2001 From: Lexi Winter Date: Tue, 1 Jul 2025 17:07:04 +0100 Subject: add nihil.std --- nihil.config/write.cc | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 nihil.config/write.cc (limited to 'nihil.config/write.cc') diff --git a/nihil.config/write.cc b/nihil.config/write.cc deleted file mode 100644 index 80125a8..0000000 --- a/nihil.config/write.cc +++ /dev/null @@ -1,41 +0,0 @@ -/* - * This source code is released into the public domain. - */ - -module; - -#include -#include -#include -#include -#include - -module nihil.config; - -import nihil.error; -import nihil.monad; -import nihil.posix; -import nihil.ucl; - -namespace nihil::config { - -auto write_to(std::filesystem::path const &filename) - -> std::expected -{ - auto uclconfig = ucl::map(); - - // Add all the options to the UCL object. - for (auto const &option : store::get().all()) { - if (option->is_default()) - continue; - - auto uobj = co_await option->ucl(); - uclconfig.insert({option->name(), uobj}); - } - - auto ucl_text = std::format("{:c}", uclconfig); - co_await safe_write_file(filename, ucl_text); - co_return {}; -} - -}; -- cgit v1.2.3