mirror of https://github.com/oxen-io/lokinet
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
667 B
C++
27 lines
667 B
C++
#include <service/config.hpp>
|
|
|
|
#include <config/ini.hpp>
|
|
|
|
namespace llarp
|
|
{
|
|
namespace service
|
|
{
|
|
bool
|
|
Config::Load(std::string_view fname)
|
|
{
|
|
ConfigParser parser;
|
|
if (!parser.LoadFile(fname))
|
|
return false;
|
|
parser.IterAll([&](std::string_view name, const ConfigParser::SectionValues_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
|