irccd
3.0.3
config.hpp
1
/*
2
* config.hpp -- irccd configuration loader
3
*
4
* Copyright (c) 2013-2019 David Demelier <markand@malikania.fr>
5
*
6
* Permission to use, copy, modify, and/or distribute this software for any
7
* purpose with or without fee is hereby granted, provided that the above
8
* copyright notice and this permission notice appear in all copies.
9
*
10
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17
*/
18
19
#ifndef IRCCD_CONFIG_HPP
20
#define IRCCD_CONFIG_HPP
21
27
#include "sysconfig.hpp"
28
29
#include <optional>
30
#include <string_view>
31
32
#include "ini.hpp"
33
34
namespace
irccd
{
35
39
class
config
:
public
ini::document
{
40
private
:
41
std::string path_;
42
43
public
:
50
static
auto
search
(std::string_view name) -> std::optional<config>;
51
57
config
(std::string path =
""
);
58
64
auto
get_path
()
const
noexcept ->
const
std::string&;
65
};
66
67
}
// !irccd
68
69
#endif // !IRCCD_CONFIG_HPP
irccd::config::config
config(std::string path="")
irccd::config
Read .ini configuration file for irccd.
Definition:
config.hpp:39
irccd::config::get_path
auto get_path() const noexcept -> const std::string &
irccd::config::search
static auto search(std::string_view name) -> std::optional< config >
irccd
Parent namespace.
Definition:
acceptor.hpp:43
irccd::ini::document
Ini document description.
Definition:
ini.hpp:376
Generated by
1.8.17