Gazebo Utils

API Reference

2.2.0
gz/utils/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

 gz
 
 gz::utils
 

Typedefs

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

Functions

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