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

A function object that writes properties to an INI configuration file. More...

#include <settings.hpp>

Public Member Functions

void operator() (path_t const &file, properties const &items) const
void operator() (properties const &items) const

Detailed Description

A function object that writes properties to an INI configuration file.

Member Function Documentation

◆ operator()() [1/2]

void oxy::core::set_fn::operator() ( path_t const & file,
properties const & items ) const
inline

This function reads the existing INI file (if it exists), updates it with the provided properties, and writes the updated configuration back to the file. It handles different data types for the property values and ensures that the INI file is correctly formatted.

Parameters
fileThe path to the INI file to write to or update.
itemsA collection of key-value pairs representing properties to write to the INI file. Values can be strings, integers, or doubles.

References oxy::expandEnvVar.

Referenced by operator()().

◆ operator()() [2/2]

void oxy::core::set_fn::operator() ( properties const & items) const
inline

This overload retrieves the default configuration file path from the singleton config_path_t and writes the provided properties to that file. It simplifies the process of updating the default configuration without needing to specify the file path explicitly.

Parameters
itemsA collection of key-value pairs representing properties to write to the INI file.

References operator()().