irccd  3.0.3
Public Member Functions | List of all members
irccd::ini::section Class Reference

Section that contains one or more options. More...

#include <ini.hpp>

Inheritance diagram for irccd::ini::section:

Public Member Functions

 section (std::string key) noexcept
 
auto get_key () const noexcept -> const std::string &
 
auto contains (std::string_view key) const noexcept -> bool
 
auto get (std::string_view key) const noexcept -> option
 
auto find (std::string_view key) noexcept -> iterator
 
auto find (std::string_view key) const noexcept -> const_iterator
 
auto operator[] (std::string_view key) -> option &
 
auto operator[] (std::string_view key) const -> const option &
 

Detailed Description

Section that contains one or more options.

Constructor & Destructor Documentation

◆ section()

irccd::ini::section::section ( std::string  key)
noexcept

Construct a section with its name.

Precondition
key must not be empty
Parameters
keythe key

Member Function Documentation

◆ contains()

auto irccd::ini::section::contains ( std::string_view  key) const -> bool
noexcept

Check if the section contains a specific option.

Parameters
keythe option key
Returns
true if the option exists

◆ find() [1/2]

auto irccd::ini::section::find ( std::string_view  key) const -> const_iterator
noexcept

Find an option by key and return an iterator.

Parameters
keythe key
Returns
the iterator or end() if not found

◆ find() [2/2]

auto irccd::ini::section::find ( std::string_view  key) -> iterator
noexcept

Find an option by key and return an iterator.

Parameters
keythe key
Returns
the iterator or end() if not found

◆ get()

auto irccd::ini::section::get ( std::string_view  key) const -> option
noexcept

Find an option or return an empty one if not found.

Parameters
keythe key
Returns
the option or empty one if not found

◆ get_key()

auto irccd::ini::section::get_key ( ) const -> const std::string &
noexcept

Get the section key.

Returns
the key

◆ operator[]() [1/2]

auto irccd::ini::section::operator[] ( std::string_view  key) -> option &

Access an option at the specified key.

Parameters
keythe key
Returns
the option
Precondition
contains(key) must return true

◆ operator[]() [2/2]

auto irccd::ini::section::operator[] ( std::string_view  key) const -> const option &

Overloaded function.

Parameters
keythe key
Returns
the option
Precondition
contains(key) must return true

The documentation for this class was generated from the following file: