19 #ifndef IRCCD_INI_UTIL_HPP
20 #define IRCCD_INI_UTIL_HPP
30 #include "string_util.hpp"
46 template <
typename Int>
49 return string_util::to_uint<Int>(sc.get(name).get_value());
61 std::string_view name,
62 std::string_view def) noexcept -> std::string
64 const auto it = sc.find(name);
67 return std::string(def);
69 return it->get_value();
80 template <
typename Int>
82 std::string_view name,
83 Int def) noexcept -> std::optional<Int>
85 const auto it = sc.find(name);
90 return string_util::to_uint<Int>(it->get_value());
Section that contains one or more options.
Definition: ini.hpp:295
auto optional_uint(const ini::section &sc, std::string_view name, Int def) noexcept -> std::optional< Int >
Definition: ini_util.hpp:81
auto get_uint(const ini::section &sc, std::string_view name) noexcept -> std::optional< Int >
Definition: ini_util.hpp:47
auto optional_string(const ini::section &sc, std::string_view name, std::string_view def) noexcept -> std::string
Definition: ini_util.hpp:60
Parent namespace.
Definition: acceptor.hpp:43