You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to have a way to set environment variables. I have at least one use-case in ros2/domain_bridge#60 (comment).
Feature description
A function that allows setting a named environment variable; essentially a dual of rcpputils::get_env_var.
Implementation considerations
It could be implemented exactly how rcpputils::get_env_var is implemented, by invoking the corresponding rcutils environment helper function.
One approach:
boolset_env_var(constchar * env_var, constchar * env_value)
{
if (!rcutils_set_env(env_var, env_value)) {
std::string err = rcutils_get_error_string().str;
// Resetting the error state since error string has been extractedrcutils_reset_error();
throwstd::runtime_error(err);
}
returntrue;
}
The text was updated successfully, but these errors were encountered:
Feature request
It would be nice to have a way to set environment variables. I have at least one use-case in ros2/domain_bridge#60 (comment).
Feature description
A function that allows setting a named environment variable; essentially a dual of
rcpputils::get_env_var
.Implementation considerations
It could be implemented exactly how
rcpputils::get_env_var
is implemented, by invoking the correspondingrcutils
environment helper function.One approach:
The text was updated successfully, but these errors were encountered: