#ifndef CFG_HH #define CFG_HH #include #include #include #include #include namespace cfg { class Config { public: virtual ~Config() = default; [[nodiscard]] virtual std::optional get(std::string_view name) const = 0; [[nodiscard]] bool has(std::string_view name) const; [[nodiscard]] std::optional get_int64(std::string_view name) const; [[nodiscard]] std::optional get_uint64(std::string_view name) const; [[nodiscard]] std::optional get_bool(std::string_view name) const; protected: Config() = default; Config(Config const&) = delete; Config& operator=(Config const&) = delete; }; [[nodiscard]] std::unique_ptr load_all(std::string_view name, std::vector& errors); [[nodiscard]] std::unique_ptr load_one(std::filesystem::path const& path, std::vector& errors); } // namespace cfg #endif // CFG_HH