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

Function object to set the value of an environment variable. More...

#include <envvar.hpp>

Public Member Functions

result< void > operator() (std::string const &name, std::string const &value) const

Detailed Description

Function object to set the value of an environment variable.

This functor provides an overload to set the value of a specified environment variable. It returns a result<void> indicating success or failure of the operation. In case of an error during the setting of the environment variable, it returns an error code. This allows for safe modification of environment variables, providing feedback on any issues encountered during the process.

Member Function Documentation

◆ operator()()

result< void > oxy::set_envVar_fn::operator() ( std::string const & name,
std::string const & value ) const
Parameters
name- The name of the environment variable to set.
value- The value to assign to the environment variable.
Returns
A result type indicating success or failure of the operation. Returns an error code on failure.