Gazebo Utils

API Reference

3.1.0
Environment.hh File Reference
#include <gz/utils/config.hh>
#include <gz/utils/Export.hh>
#include <string>
#include <unordered_map>
#include <vector>

Go to the source code of this file.

Namespaces

namespace  gz
 
namespace  gz::utils
 

Typedefs

using EnvironmentMap = std::unordered_map< std::string, std::string >
 Type alias for a collection of environment variables.
 
using EnvironmentStrings = std::vector< std::string >
 Type alias for a collection of environment variables Each entry is of the form KEY=VAL.
 

Functions

bool clearenv ()
 Unset all environment variables.
 
EnvironmentMap env ()
 Retrieve all current environment variables.
 
bool env (const std::string &_name, std::string &_value, bool _allowEmpty=false)
 Find the environment variable '_name' and return its value.
 
EnvironmentStrings envMapToStrings (const EnvironmentMap &_envMap)
 Convert a map of environment variables to a vector.
 
EnvironmentMap envStringsToMap (const EnvironmentStrings &_envStrings)
 Convert a vector of environment variables to a map.
 
std::string printenv ()
 Print the entire current environment to a string.
 
bool setenv (const EnvironmentMap &_vars)
 Set the environment variable '_name'.
 
bool setenv (const std::string &_name, const std::string &_value)
 Set the environment variable '_name'.
 
bool unsetenv (const std::string &_name)
 Unset the environment variable '_name'.