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

Function object to expand environment variables in strings and paths. More...

#include <envvar.hpp>

Public Member Functions

result< std::filesystem::path > operator() (std::filesystem::path const &source) const
result< std::string > operator() (std::string const &source) const

Detailed Description

Function object to expand environment variables in strings and paths.

This functor provides two overloads to expand environment variables in a given string or filesystem path. It returns a result type that contains the expanded string or path on success, or an error code on failure. This allows for safe handling of environment variable expansion, providing feedback on any issues encountered during the process.

Member Function Documentation

◆ operator()() [1/2]

result< std::filesystem::path > oxy::expandEnvVar_fn::operator() ( std::filesystem::path const & source) const
Parameters
source- The input filesystem path containing environment variables to be expanded.
Returns
A result type containing the expanded path on success, or an error code on failure.

◆ operator()() [2/2]

result< std::string > oxy::expandEnvVar_fn::operator() ( std::string const & source) const
Parameters
source- The input string containing environment variables to be expanded.
Returns
A result type containing the expanded string on success, or an error code on failure.