OXY API 1.0
OXY API Library Documentation
Loading...
Searching...
No Matches
oxy::core::load_fn Struct Reference

Function object to load settings from an INI file. More...

#include <settings.hpp>

Public Member Functions

settings_t operator() (const path_t &file) const

Detailed Description

Function object to load settings from an INI file.

Member Function Documentation

◆ operator()()

settings_t oxy::core::load_fn::operator() ( const path_t & file) const
inline

This function reads an INI file and populates a settings_t structure with the values found in the file. It uses Boost.PropertyTree to parse the INI file and extract the relevant settings. If the file does not exist, it returns the default settings. After loading, it expands any environment variables in the paths using the expand function.

Parameters
fileThe path to the INI file from which to load settings.

References oxy::core::expand, oxy::expandEnvVar, and oxy::core::remove_quote.