aboutsummaryrefslogtreecommitdiff
path: root/lib/configuration/init_global.cpp.in
blob: 9179130a09d95ea93d219e029c92c6abc96b3088 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* 
 * This is a generated file.
 *
 * This file is part of smolbote. It's copyrighted by the contributors recorded
 * in the version control history of the file, available from its original
 * location: https://neueland.iserlohn-fortress.net/cgit/smolbote.git
 *
 * SPDX-License-Identifier: GPL-3.0
 */

#include "configuration.h"

std::string Configuration::init_global(const std::string &p_path)
{
    auto value_map = std::make_unique<Configuration, std::initializer_list<std::pair<std::string, conf_value_t>>>({
        /* @__DEFAULT_CFG__ */
    });

    // load the actual configuration file
    const auto cfgpath = p_path.empty() ? value_map->value<std::string>("poi/config").value() : p_path;
    value_map->read_file(cfgpath);

    move_global(std::move(value_map));
    return cfgpath;
}