irccd  3.0.3
Functions
irccd::ini_util Namespace Reference

Ini utilities. More...

Functions

template<typename Int >
auto get_uint (const ini::section &sc, std::string_view name) noexcept -> std::optional< Int >
 
auto optional_string (const ini::section &sc, std::string_view name, std::string_view def) noexcept -> std::string
 
template<typename Int >
auto optional_uint (const ini::section &sc, std::string_view name, Int def) noexcept -> std::optional< Int >
 

Detailed Description

Ini utilities.

Function Documentation

◆ get_uint()

template<typename Int >
auto irccd::ini_util::get_uint ( const ini::section sc,
std::string_view  name 
) -> std::optional<Int>
inlinenoexcept

Get an unsigned integer from the configuration section.

Parameters
scthe section
namethe option name
Returns
the value or none if not able to convert

◆ optional_string()

auto irccd::ini_util::optional_string ( const ini::section sc,
std::string_view  name,
std::string_view  def 
) -> std::string
inlinenoexcept

Get an optional string or the default value if not given.

Parameters
scthe section
namethe option name
defthe default value
Returns
the value or def if not found

◆ optional_uint()

template<typename Int >
auto irccd::ini_util::optional_uint ( const ini::section sc,
std::string_view  name,
Int  def 
) -> std::optional<Int>
inlinenoexcept

Get an optional unsigned integer from the configuration section.

Parameters
scthe section
namethe option name
defthe default value
Returns
the value or none if not able to convert