Section that contains one or more options.
More...
#include <ini.hpp>
|
| 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 & |
|
Section that contains one or more options.
◆ section()
irccd::ini::section::section |
( |
std::string |
key | ) |
|
|
noexcept |
Construct a section with its name.
- Precondition
- key must not be empty
- Parameters
-
◆ contains()
auto irccd::ini::section::contains |
( |
std::string_view |
key | ) |
const -> bool |
|
noexcept |
Check if the section contains a specific option.
- Parameters
-
- 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
-
- 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
-
- 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
-
- 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
-
- 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
-
- Returns
- the option
- Precondition
- contains(key) must return true
The documentation for this class was generated from the following file: