mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-11 07:10:36 +00:00
54186c4a89
When we add loki-mq has a dependency we can just alias it, but for now it's easier to copy the header than add the whole submodule library.
28 lines
684 B
C++
28 lines
684 B
C++
#include <service/config.hpp>
|
|
|
|
#include <config/ini.hpp>
|
|
|
|
namespace llarp
|
|
{
|
|
namespace service
|
|
{
|
|
bool
|
|
Config::Load(string_view fname)
|
|
{
|
|
ConfigParser parser;
|
|
if(!parser.LoadFile(fname))
|
|
return false;
|
|
parser.IterAll(
|
|
[&](string_view name, const ConfigParser::Section_t& section) {
|
|
Config::section_t values;
|
|
values.first.assign(name.begin(), name.end());
|
|
for(const auto& item : section)
|
|
values.second.emplace_back(item.first, item.second);
|
|
services.emplace_back(values);
|
|
});
|
|
return services.size() > 0;
|
|
}
|
|
|
|
} // namespace service
|
|
} // namespace llarp
|