diff --git a/include/ircd/conf.h b/include/ircd/conf.h index 2ee7754c8..bfe64c9c5 100644 --- a/include/ircd/conf.h +++ b/include/ircd/conf.h @@ -17,6 +17,8 @@ namespace ircd::conf template struct value; // abstraction for carrying item value template<> struct item; // base class of all conf items template<> struct item; + template<> struct item; + template<> struct item; template<> struct item; IRCD_EXCEPTION(ircd::error, error) @@ -99,6 +101,50 @@ struct ircd::conf::item {} }; +template<> +struct ircd::conf::item +:conf::item<> +,conf::value +{ + string_view get(const mutable_buffer &out) const override + { + return lex_cast(_value, out); + } + + bool set(const string_view &s) override + { + _value = lex_cast(s); + return true; + } + + item(const json::members &memb) + :conf::item<>{memb} + ,value{feature.get("default", 0UL)} + {} +}; + +template<> +struct ircd::conf::item +:conf::item<> +,conf::value +{ + string_view get(const mutable_buffer &out) const override + { + return lex_cast(_value, out); + } + + bool set(const string_view &s) override + { + _value = lex_cast(s); + return true; + } + + item(const json::members &memb) + :conf::item<>{memb} + ,value{feature.get("default", 0L)} + {} +}; + template<> struct ircd::conf::item :conf::item<>