/* * This source code is released into the public domain. */ module; #include #include #include export module nihil.config:string; import nihil.ucl; import :option; namespace nihil::config { /* * A string option. The backing type is std::string. */ export struct string final : option { string(std::string &storage, std::string_view name, std::string_view description) noexcept; ~string(); /* * Get this option as a string; simply returns the storage. */ [[nodiscard]] auto get_string() const -> std::string override; /* * Set this option to a string value; assigns to the storage. */ [[nodiscard]] auto set_string(std::string_view new_value) -> std::expected override; /* * Convert this option to a UCL object. */ [[nodiscard]] auto get_ucl() const -> std::expected override; /* * Set this option from a UCL object. */ [[nodiscard]] auto set_ucl(ucl::object const &uclobj) -> std::expected override; private: std::string &m_storage; }; } // namespace nihil::config